Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closes #360
[r,g,b]
,[h,s,v]
/[h,s,b]
, and[h,s,l]
. An implementation difficulty is that saturation is defined differently between HSV and HSL. Most color pickers work in HSV. The workaround is as follows: TheRoot
component will accept aformat
, which is one ofrgb
orhsv
(hsl may not be supported initially because usage is very low). Many components accept achannel
. This channel is one ofhue|saturation|value|red|green|blue|alpha
. Only channels defined by the format choice will be allowed (for instance, ifformat
isrgb
, you cannot usehue
). You may then useColorPicker.View
to display and allow editing the color in a different format, conversions will be handled automatically.#rrggbb
, and supporting these colors requires a drastic amount of work.value
will not include alpha.withAlpha
must be manually enabled. In this case, the input will continue to not include alpha, but thevalue
will. The value will always be in the format#rrggbb
or#rrggbbaa
, regardless of theformat
prop.Checklist
ColorPicker.Root
ColorPicker.Area
y
axis is brightness, and thex
axis is saturation.ColorPicker.AreaBackground
x
andy
channels is not feasible. We can provide a default implementation forsaturation
andvalue
, and allow the user to provide a custom implementation. Throw if this implementation is not provided.ColorPicker.AreaThumb
ColorPicker.Slider
x
axis is hue. Can we use Kobalte's Slider component?ColorPicker.ChannelSliderBackground
ColorPicker.ChannelSliderThumb
ColorPicker.TransparencyGrid
ColorPicker.ChannelInput
ColorPicker.View