colors: can't bootstrap when using locals in colors...

db4
John Benediktsson 2012-10-21 14:53:24 -07:00
parent 659dbd0add
commit a06169fa3f
1 changed files with 4 additions and 4 deletions

View File

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