From 1d9a0f40fc8a392fde0f20bfa9af1cdf4bbeec1d Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Sun, 21 Oct 2012 13:16:34 -0700 Subject: [PATCH] colors: adding inverse-color. --- basis/colors/colors.factor | 3 +++ 1 file changed, 3 insertions(+) diff --git a/basis/colors/colors.factor b/basis/colors/colors.factor index cdcd0ec93e..4e178c56a7 100644 --- a/basis/colors/colors.factor +++ b/basis/colors/colors.factor @@ -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 ; + +: inverse-color ( color -- color' ) + >rgba-components [ [ 1.0 swap - ] tri@ ] dip ;