]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/color-table/color-table.factor
colors: using 255 * round >integer for hex conversion
[factor.git] / extra / color-table / color-table.factor
index ea7d6f5d63b428f862c006a1cebec2dda745d910..03914c67d3ab45d67958538dbefbe9bbd7301697 100644 (file)
@@ -1,9 +1,9 @@
 ! Copyright (C) 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors colors combinators combinators.smart formatting
-kernel literals math models sorting.human sorting.slots strings ui
-ui.gadgets.scrollers ui.gadgets.search-tables ui.gadgets.tables
-;
+kernel literals math math.functions models sorting.human
+sorting.slots strings ui ui.gadgets.scrollers
+ui.gadgets.search-tables ui.gadgets.tables ;
 IN: color-table
 
 ! ui.gadgets.tables demo
@@ -15,7 +15,7 @@ CONSTANT: full-block-string $[ 10 CHAR: full-block <string> ]
 
 : rgba>hex ( rgba -- hex )
     [ red>> ] [ green>> ] [ blue>> ] tri
-    [ 255 * >integer ] tri@ "%02X%02X%02X" sprintf ;
+    [ 255 * round >integer ] tri@ "%02X%02X%02X" sprintf ;
 
 PRIVATE>