]> gitweb.factorcode.org Git - factor.git/commitdiff
colors: adding inverse-color.
authorJohn Benediktsson <mrjbq7@gmail.com>
Sun, 21 Oct 2012 20:16:34 +0000 (13:16 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sun, 21 Oct 2012 20:16:34 +0000 (13:16 -0700)
basis/colors/colors.factor

index cdcd0ec93e3a8b4ebafa23b233bcbd3fac3d74b5..4e178c56a71d7cd640ea0abd676b99fb1f586186 100644 (file)
@@ -33,3 +33,6 @@ CONSTANT: transparent T{ rgba f 0.0 0.0 0.0 0.0 }
     color1 >rgba-components drop [ 1.0 percent - * ] tri@
     color2 >rgba-components drop [ percent * ] tri@
     [ + ] tri-curry@ tri* 1.0 <rgba> ;
+
+: inverse-color ( color -- color' )
+    >rgba-components [ [ 1.0 swap - ] tri@ ] dip <rgba> ;