color-picker: Use color objects

db4
Eduardo Cavazos 2008-08-01 17:15:44 -05:00
parent 0763124bb9
commit 438fd22bd3
1 changed files with 2 additions and 2 deletions

View File

@ -4,7 +4,7 @@ USING: kernel math math.functions math.parser models
models.filter models.range models.compose sequences ui
ui.gadgets ui.gadgets.frames ui.gadgets.labels ui.gadgets.packs
ui.gadgets.sliders ui.render math.geometry.rect accessors
ui.gadgets.grids ;
ui.gadgets.grids colors ;
IN: color-picker
! Simple example demonstrating the use of models.
@ -23,7 +23,7 @@ M: color-preview model-changed
swap model-value over set-gadget-interior relayout-1 ;
: <color-model> ( model -- model )
[ [ 256 /f ] map 1 suffix <solid> ] <filter> ;
[ [ 256 /f ] map 1 suffix first4 rgba boa <solid> ] <filter> ;
: <color-sliders> ( -- model gadget )
3 [ 0 0 0 255 <range> ] replicate