]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/tinyvg/tinyvg.factor
colors: using 255 * round >integer for hex conversion
[factor.git] / extra / tinyvg / tinyvg.factor
index 95f41a81ce51cacabaff37e982e44410901c6df2..8500bd8830a6ca2d870c08a24ac593ae002c97c4 100644 (file)
@@ -1,9 +1,9 @@
 ! Copyright (C) 2021 John Benediktsson
 ! See http://factorcode.org/license.txt for BSD license
 
-USING: accessors colors combinators generalizations io io.binary
+USING: accessors colors combinators endian generalizations io
 io.encodings.binary io.files io.streams.byte-array kernel math
-math.bitwise namespaces sequences ;
+math.bitwise math.functions namespaces sequences ;
 
 IN: tinyvg
 
@@ -38,7 +38,7 @@ ERROR: invalid-length n ;
     [ read1 255 /f ] 4 call-n <rgba> ;
 
 : write-rgba-8888 ( rgba -- )
-    >rgba-components [ 255 * >integer write1 ] 4 napply ;
+    >rgba-components [ 255 * round >integer write1 ] 4 napply ;
 
 : read-rgb-565 ( -- rgba )
     2 read le>