]> gitweb.factorcode.org Git - factor.git/commitdiff
colors: can't bootstrap when using locals in colors...
authorJohn Benediktsson <mrjbq7@gmail.com>
Sun, 21 Oct 2012 21:53:24 +0000 (14:53 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sun, 21 Oct 2012 21:53:24 +0000 (14:53 -0700)
basis/colors/colors.factor

index 4e178c56a71d7cd640ea0abd676b99fb1f586186..25830630e9aed9ff4733dab7e7e4daf4363d66cc 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2003, 2009 Slava Pestov.
 ! Copyright (C) 2008 Eduardo Cavazos.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors combinators kernel math locals ;
+USING: accessors combinators kernel math ;
 IN: colors
 
 TUPLE: color ;
@@ -29,9 +29,9 @@ M: color blue>> ( color -- blue ) >rgba blue>> ;
 
 CONSTANT: transparent T{ rgba f 0.0 0.0 0.0 0.0 }
 
-:: linear-gradient ( color1 color2 percent -- color )
-    color1 >rgba-components drop [ 1.0 percent - * ] tri@
-    color2 >rgba-components drop [ percent * ] tri@
+: linear-gradient ( color1 color2 percent -- color )
+    [ 1.0 swap - * ] [ * ] bi-curry swapd
+    [ [ >rgba-components drop ] [ tri@ ] bi* ] 2bi@
     [ + ] tri-curry@ tri* 1.0 <rgba> ;
 
 : inverse-color ( color -- color' )