Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanbaird committed Dec 16, 2023
1 parent 63b952d commit acd5f08
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ When you use the ``ColorWellStyle/expanded`` or ``ColorWellStyle/minimal`` color
ColorWellView(selection: $color)
.colorWellSwatchColors([
.red, .orange, .yellow, .green, .blue, .indigo,
.purple, .brown, .gray, .black, .white,
.purple, .brown, .gray, .white, .black,
])
.colorWellStyle(.expanded)
```
Expand Down
28 changes: 21 additions & 7 deletions Sources/ColorWellKit/Views/SwiftUI/ViewModifiers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,22 @@ extension View {
/// Sets the colors of the swatches in color selection popovers
/// displayed by color wells in this view.
///
/// Color selection popovers are displayed by color wells with
/// the ``ColorWellStyle/expanded`` or ``ColorWellStyle/minimal``
/// styles.
///
/// ```swift
/// ColorWellView(selection: $color)
/// .colorWellSwatchColors([
/// .red, .orange, .yellow, .green, .blue, .indigo,
/// .purple, .brown, .gray, .white, .black,
/// ])
/// .colorWellStyle(.expanded)
/// ```
///
/// - Note: If the ``colorWellSecondaryAction(_:)`` modifier is
/// also applied, the color wells in this view perform the provided
/// action instead, and this modifier has no effect.
/// also applied, the color wells in this view perform the
/// provided action instead, and this modifier has no effect.
///
/// - Parameter colors: The colors to use to create the swatches.
@available(macOS 11.0, *)
Expand All @@ -33,11 +46,12 @@ extension View {
/// Sets an action to perform when the color areas of color wells
/// in this view are pressed.
///
/// - Note: If this modifier is applied, the color wells in this
/// view perform the provided action instead of displaying the
/// default color selection popover. As such, modifiers that alter
/// the default popover (such as ``colorWellSwatchColors(_:)``)
/// do not take effect if this modifier is also applied.
/// - Note: If this modifier is applied, color wells in this view
/// with the ``ColorWellStyle/expanded`` or ``ColorWellStyle/minimal``
/// styles perform this action instead of displaying the default
/// color selection popover. As such, modifiers that alter the
/// default popover (such as ``colorWellSwatchColors(_:)``) will
/// not take effect if this modifier is also applied.
///
/// - Parameter action: An action to perform when the color areas
/// of color wells in this view are pressed.
Expand Down

0 comments on commit acd5f08

Please sign in to comment.