From 7c6b7762f9c5e853044573e31fed5b921022fdab Mon Sep 17 00:00:00 2001 From: Eduardo Cavazos Date: Mon, 28 Jul 2008 18:05:52 -0500 Subject: [PATCH 1/4] colors: fix copyright year --- extra/colors/colors.factor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra/colors/colors.factor b/extra/colors/colors.factor index 02ad3ac778..ce141c489e 100644 --- a/extra/colors/colors.factor +++ b/extra/colors/colors.factor @@ -1,4 +1,4 @@ -! Copyright (C) 2003, 2007 Slava Pestov. +! Copyright (C) 2003, 2007, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: kernel combinators sequences arrays From 1c61b7734c35e18fde50823c342527af4307bc9e Mon Sep 17 00:00:00 2001 From: Eduardo Cavazos Date: Mon, 28 Jul 2008 18:27:28 -0500 Subject: [PATCH 2/4] colors: 'gray' instead of 'grey' --- extra/colors/colors.factor | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extra/colors/colors.factor b/extra/colors/colors.factor index ce141c489e..3621373d93 100644 --- a/extra/colors/colors.factor +++ b/extra/colors/colors.factor @@ -14,7 +14,7 @@ TUPLE: rgba < color red green blue alpha ; TUPLE: hsva < color hue saturation value alpha ; -TUPLE: grey < color grey alpha ; +TUPLE: gray < color gray alpha ; ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -26,7 +26,7 @@ METHOD: >rgba { hsva } { [ hue>> ] [ saturation>> ] [ value>> ] [ alpha>> ] } cleave 4array [ hsv>rgb ] [ peek ] bi suffix first4 rgba boa ; -METHOD: >rgba { grey } [ grey>> dup dup ] [ alpha>> ] bi rgba boa ; +METHOD: >rgba { gray } [ gray>> dup dup ] [ alpha>> ] bi rgba boa ; METHOD: >rgba { array } first4 rgba boa ; From 463b3ff87d20032443dafdba9bc4760742825867 Mon Sep 17 00:00:00 2001 From: Eduardo Cavazos Date: Mon, 28 Jul 2008 22:04:18 -0500 Subject: [PATCH 3/4] colors: use old style methods --- extra/colors/colors.factor | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/extra/colors/colors.factor b/extra/colors/colors.factor index 3621373d93..e3920bebe3 100644 --- a/extra/colors/colors.factor +++ b/extra/colors/colors.factor @@ -1,8 +1,7 @@ ! Copyright (C) 2003, 2007, 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: kernel combinators sequences arrays - classes.tuple multi-methods accessors colors.hsv ; +USING: kernel combinators sequences arrays classes.tuple accessors colors.hsv ; IN: colors @@ -20,23 +19,19 @@ TUPLE: gray < color gray alpha ; GENERIC: >rgba ( object -- rgba ) -METHOD: >rgba { rgba } ; +M: rgba >rgba ( rgba -- rgba ) ; -METHOD: >rgba { hsva } +M: hsva >rgba ( hsva -- rgba ) { [ hue>> ] [ saturation>> ] [ value>> ] [ alpha>> ] } cleave 4array [ hsv>rgb ] [ peek ] bi suffix first4 rgba boa ; -METHOD: >rgba { gray } [ gray>> dup dup ] [ alpha>> ] bi rgba boa ; +M: gray >rgba ( gray -- rgba ) [ gray>> dup dup ] [ alpha>> ] bi rgba boa ; -METHOD: >rgba { array } first4 rgba boa ; +M: array >rgba ( array -- rgba ) first4 rgba boa ; -! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -USE: syntax - -M: color red>> >rgba red>> ; -M: color green>> >rgba green>> ; -M: color blue>> >rgba blue>> ; +M: color ( color -- red ) red>> >rgba red>> ; +M: color ( color -- green ) green>> >rgba green>> ; +M: color ( color -- blue ) blue>> >rgba blue>> ; ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! From ba61e15689a376c80091515303d111156f502601 Mon Sep 17 00:00:00 2001 From: Eduardo Cavazos Date: Mon, 28 Jul 2008 22:06:46 -0500 Subject: [PATCH 4/4] colors: minor change --- extra/colors/colors.factor | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/extra/colors/colors.factor b/extra/colors/colors.factor index e3920bebe3..ae3695cf8b 100644 --- a/extra/colors/colors.factor +++ b/extra/colors/colors.factor @@ -29,9 +29,9 @@ M: gray >rgba ( gray -- rgba ) [ gray>> dup dup ] [ alpha>> ] bi rgba boa ; M: array >rgba ( array -- rgba ) first4 rgba boa ; -M: color ( color -- red ) red>> >rgba red>> ; -M: color ( color -- green ) green>> >rgba green>> ; -M: color ( color -- blue ) blue>> >rgba blue>> ; +M: color red>> ( color -- red ) >rgba red>> ; +M: color green>> ( color -- green ) >rgba green>> ; +M: color blue>> ( color -- blue ) >rgba blue>> ; ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!