color-table: 5 decimal places.
parent
f8b1269ef2
commit
57403b72ae
|
@ -1,8 +1,8 @@
|
||||||
! Copyright (C) 2009 Slava Pestov.
|
! Copyright (C) 2009 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: kernel accessors combinators.smart sorting.human
|
USING: accessors colors.constants combinators.smart formatting
|
||||||
models colors.constants present sorting.slots combinators
|
kernel literals models sorting.human sorting.slots strings ui
|
||||||
ui ui.gadgets.tables ui.gadgets.scrollers strings literals ;
|
ui.gadgets.scrollers ui.gadgets.tables ;
|
||||||
IN: color-table
|
IN: color-table
|
||||||
|
|
||||||
! ui.gadgets.tables demo
|
! ui.gadgets.tables demo
|
||||||
|
@ -24,9 +24,9 @@ M: color-renderer row-columns
|
||||||
drop [
|
drop [
|
||||||
full-block-string swap
|
full-block-string swap
|
||||||
dup named-color
|
dup named-color
|
||||||
[ red>> present ]
|
[ red>> "%.5f" sprintf ]
|
||||||
[ green>> present ]
|
[ green>> "%.5f" sprintf ]
|
||||||
[ blue>> present ] tri
|
[ blue>> "%.5f" sprintf ] tri
|
||||||
] output>array ;
|
] output>array ;
|
||||||
|
|
||||||
M: color-renderer row-color
|
M: color-renderer row-color
|
||||||
|
@ -44,5 +44,5 @@ M: color-renderer row-value
|
||||||
10 >>min-rows
|
10 >>min-rows
|
||||||
10 >>max-rows ;
|
10 >>max-rows ;
|
||||||
|
|
||||||
MAIN-WINDOW: color-table-demo { { title "Colors" } }
|
MAIN-WINDOW: color-table-demo { { title "Colors" } { pref-dim { 450 300 } } }
|
||||||
<color-table> <scroller> >>gadgets ;
|
<color-table> <scroller> >>gadgets ;
|
||||||
|
|
Loading…
Reference in New Issue