@ -6,6 +6,7 @@
type ColorPickerVariant,
type ColorPickerVariant,
type ChannelInputSnippetProps
type ChannelInputSnippetProps
} from '$uix/eidos/components/color-picker';
} from '$uix/eidos/components/color-picker';
import { PickerShell } from '$uix/eidos/components/picker-shell';
import { compileMorfo } from '$uix/morfo';
import { compileMorfo } from '$uix/morfo';
import { colorPickerMorfo } from '@/uix/morfo/components/color-picker';
import { colorPickerMorfo } from '@/uix/morfo/components/color-picker';
import { colorFieldMorfo } from '@/uix/morfo/components/color-field';
import { colorFieldMorfo } from '@/uix/morfo/components/color-field';
@ -149,25 +150,27 @@
' < ColorPicker.Trigger > < ColorPicker.ValueText / > < / ColorPicker.Trigger > ',
' < ColorPicker.Trigger > < ColorPicker.ValueText / > < / ColorPicker.Trigger > ',
' < / ColorPicker.Control > ',
' < / ColorPicker.Control > ',
' < ColorPicker.Content > ',
' < ColorPicker.Content > ',
' < ColorPicker.Area > ',
' < PickerShell.Body > ',
' < ColorPicker.AreaBackground / > ',
' < ColorPicker.Area > ',
' < ColorPicker.AreaThumb / > ',
' < ColorPicker.AreaBackground / > ',
' < / ColorPicker.Area > ',
' < ColorPicker.AreaThumb / > ',
' < ColorPicker.ChannelSlider channel = "hue" > ',
' < / ColorPicker.Area > ',
' < ColorPicker.ChannelSliderTrack / > < ColorPicker.ChannelSliderThumb / > ',
' < ColorPicker.ChannelSlider channel = "hue" > ',
' < / ColorPicker.ChannelSlider > ',
' < ColorPicker.ChannelSliderTrack / > < ColorPicker.ChannelSliderThumb / > ',
enableAlpha & & ' < ColorPicker.ChannelSlider channel = "alpha" > ',
' < / ColorPicker.ChannelSlider > ',
enableAlpha & & ' < ColorPicker.ChannelSliderTrack / > < ColorPicker.ChannelSliderThumb / > ',
enableAlpha & & ' < ColorPicker.ChannelSlider channel = "alpha" > ',
enableAlpha & & ' < / ColorPicker.ChannelSlider > ',
enableAlpha & & ' < ColorPicker.ChannelSliderTrack / > < ColorPicker.ChannelSliderThumb / > ',
' < ColorPicker.ValueSwatch / > ',
enableAlpha & & ' < / ColorPicker.ChannelSlider > ',
' < ColorPicker.ChannelInput / > ',
' < ColorPicker.ValueSwatch / > ',
' < ColorPicker.EyeDropper / > ',
' < ColorPicker.ChannelInput / > ',
' < ColorPicker.SwatchGroup > ',
' < ColorPicker.EyeDropper / > ',
' { #each presets as c } < ColorPicker.SwatchTrigger color = { c } > ',
' < ColorPicker.SwatchGroup > ',
' < ColorPicker.Swatch color = { c } / > ',
' { #each presets as c } < ColorPicker.SwatchTrigger color = { c } > ',
' < ColorPicker.SwatchIndicator / > ',
' < ColorPicker.Swatch color = { c } / > ',
' </ ColorPicker.SwatchTrigger > { /each } ',
' < ColorPicker.SwatchIndicator / > ',
' < / ColorPicker.SwatchGroup > ',
' </ ColorPicker.SwatchTrigger > { /each } ',
' < / ColorPicker.SwatchGroup > ',
' < / PickerShell.Body > ',
showFooter & & (showClear || showCancel || showClose) & & ' < PickerShell.Footer > ',
showFooter & & (showClear || showCancel || showClose) & & ' < PickerShell.Footer > ',
showFooter & & showClear & & ' < PickerShell.Clear / > ',
showFooter & & showClear & & ' < PickerShell.Clear / > ',
showFooter & & showCancel & & ' < PickerShell.Cancel / > ',
showFooter & & showCancel & & ' < PickerShell.Cancel / > ',
@ -184,6 +187,7 @@
[
[
"< script lang = 'ts' > " ,
"< script lang = 'ts' > " ,
" import { ColorPicker } from '$uix/eidos/components/color-picker';",
" import { ColorPicker } from '$uix/eidos/components/color-picker';",
" import { PickerShell } from '$uix/eidos/components/picker-shell';",
" import { colorValueFromRgb , type ColorValue } from '$libs/color';",
" import { colorValueFromRgb , type ColorValue } from '$libs/color';",
'',
'',
' let value = $state< ColorValue | undefined > (colorValueFromRgb({ r : 30 , g : 144 , b : 255 , a : 1 } ));',
' let value = $state< ColorValue | undefined > (colorValueFromRgb({ r : 30 , g : 144 , b : 255 , a : 1 } ));',
@ -207,16 +211,18 @@
' < / ColorPicker.Control > ',
' < / ColorPicker.Control > ',
' < ColorPicker.Portal > ',
' < ColorPicker.Portal > ',
' < ColorPicker.Content > ',
' < ColorPicker.Content > ',
' < ColorPicker.Area / > ',
' < PickerShell.Body > ',
' < ColorPicker.ChannelSlider channel = "hue" / > ',
' < ColorPicker.Area / > ',
enableAlpha & & ' < ColorPicker.ChannelSlider channel = "alpha" / > ',
' < ColorPicker.ChannelSlider channel = "hue" / > ',
' <!-- compact value row: swatch + channel input + eyedropper --> ',
enableAlpha & & ' < ColorPicker.ChannelSlider channel = "alpha" / > ',
' < ColorPicker.ValueSwatch / > ',
' <!-- compact value row: swatch + channel input + eyedropper --> ',
' < ColorPicker.ChannelInput / > ',
' < ColorPicker.ValueSwatch / > ',
' < ColorPicker.EyeDropper / > ',
' < ColorPicker.ChannelInput / > ',
' < ColorPicker.SwatchGroup > ',
' < ColorPicker.EyeDropper / > ',
' { #each presets as c } < ColorPicker.SwatchTrigger color = { c } / > { /each } ',
' < ColorPicker.SwatchGroup > ',
' < / ColorPicker.SwatchGroup > ',
' { #each presets as c } < ColorPicker.SwatchTrigger color = { c } / > { /each } ',
' < / ColorPicker.SwatchGroup > ',
' < / PickerShell.Body > ',
showFooter & & (showClear || showCancel || showClose) & & ' < ColorPicker.Footer > ',
showFooter & & (showClear || showCancel || showClose) & & ' < ColorPicker.Footer > ',
showFooter & & showClear & & ' < ColorPicker.Clear / > ',
showFooter & & showClear & & ' < ColorPicker.Clear / > ',
showFooter & & showCancel & & ' < ColorPicker.Cancel / > ',
showFooter & & showCancel & & ' < ColorPicker.Cancel / > ',
@ -279,45 +285,47 @@
< ColorPicker.Portal >
< ColorPicker.Portal >
< ColorPicker.Content >
< ColorPicker.Content >
< ColorPicker.Area / >
< PickerShell.Body >
< ColorPicker.Area / >
<!-- Channel sliders with explicit row labels so users
know what each gradient drives. -->
<!-- Channel sliders with explicit row labels so users
< div class = "cp-slider-row" >
know what each gradient drives. -->
< span class = "cp-slider-label" > Hue< / span >
< ColorPicker.ChannelSlider channel = "hue" / >
< / div >
{ #if enableAlpha }
< div class = "cp-slider-row" >
< div class = "cp-slider-row" >
< span class = "cp-slider-label" > Alpha< / span >
< span class = "cp-slider-label" > Hue< / span >
< ColorPicker.ChannelSlider channel = "alpha" / >
< ColorPicker.ChannelSlider channel = "hue" / >
< / div >
{ #if enableAlpha }
< div class = "cp-slider-row" >
< span class = "cp-slider-label" > Alpha< / span >
< ColorPicker.ChannelSlider channel = "alpha" / >
< / div >
{ /if }
<!-- Compact value row: live preview swatch + segmented channel
input + format select + eyedropper, all on one line. -->
< div class = "cp-value-row" >
< ColorPicker.ValueSwatch / >
< ColorPicker.ChannelInput >
{ # snippet children ({ segments } : ChannelInputSnippetProps )}
{ #each segments as { part , value }, i ( `$ { part } - $ { i } `) }
< ColorPicker.ChannelSegment { part } > { value } </ ColorPicker.ChannelSegment >
{ /each }
< ColorPicker.FormatSelect / >
{ /snippet }
< / ColorPicker.ChannelInput >
< ColorPicker.EyeDropper aria-label = "Pick color from screen" / >
< / div >
< / div >
{ /if }
<!-- Compact value row: live preview swatch + segmented channel
< div class = "cp-section-label" > Preset colors< / div >
input + format select + eyedropper, all on one line. -->
< ColorPicker.SwatchGroup aria-label = "Preset colors" >
< div class = "cp-value-row" >
{ #each presets as preset }
< ColorPicker.ValueSwatch / >
< ColorPicker.SwatchTrigger color = { preset } >
< ColorPicker.ChannelInput >
< ColorPicker.Swatch color = { preset } / >
{ # snippet children ({ segments } : ChannelInputSnippetProps )}
< ColorPicker.SwatchIndicator / >
{ #each segments as { part , value }, i ( `$ { part } - $ { i } `) }
< / ColorPicker.SwatchTrigger >
< ColorPicker.ChannelSegment { part } > { value } </ ColorPicker.ChannelSegment >
{ /each }
{ /each }
< / ColorPicker.SwatchGroup >
< ColorPicker.FormatSelect / >
< / PickerShell.Body >
{ /snippet }
< / ColorPicker.ChannelInput >
< ColorPicker.EyeDropper aria-label = "Pick color from screen" / >
< / div >
< div class = "cp-section-label" > Preset colors< / div >
< ColorPicker.SwatchGroup aria-label = "Preset colors" >
{ #each presets as preset }
< ColorPicker.SwatchTrigger color = { preset } >
< ColorPicker.Swatch color = { preset } / >
< ColorPicker.SwatchIndicator / >
< / ColorPicker.SwatchTrigger >
{ /each }
< / ColorPicker.SwatchGroup >
{ #if showFooter && ( showClear || showCancel || showClose )}
{ #if showFooter && ( showClear || showCancel || showClose )}
< ColorPicker.Footer >
< ColorPicker.Footer >