]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/html/streams/streams.factor
colors: using 255 * round >integer for hex conversion
[factor.git] / basis / html / streams / streams.factor
index 3590db7e56125d790364f499892b5b35a48e94e7..efe51db989b7fd160193a2624348999941f78a26 100644 (file)
@@ -2,8 +2,8 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors assocs combinators destructors fry html io
 io.backend io.pathnames io.styles kernel macros make math
-math.order math.parser namespaces sequences strings words
-splitting xml xml.syntax ;
+math.functions math.order math.parser namespaces sequences
+strings words splitting xml xml.syntax ;
 IN: html.streams
 
 GENERIC: url-of ( object -- url )
@@ -36,7 +36,7 @@ TUPLE: html-sub-stream < html-writer style parent ;
 
 : hex-color, ( color -- )
     [ red>> ] [ green>> ] [ blue>> ] tri
-    [ 255 * >integer >hex 2 CHAR: 0 pad-head % ] tri@ ;
+    [ 255 * round >integer >hex 2 CHAR: 0 pad-head % ] tri@ ;
 
 : fg-css, ( color -- )
     "color: #" % hex-color, "; " % ;