[cl-colors-devel] rgba-combination

Tamas K Papp tpapp at Princeton.EDU
Sun Jun 29 09:03:05 UTC 2008


Thanks Johann,

I applied the patch.

Tamas

On Sun, Jun 29, 2008 at 01:37:40AM +0200, johann korndoerfer wrote:
> hi
> 
> attached is a patch for extending cl-colors to provide convex
> combination of rgba colors, too.
> 
> greets
> johann

> Index: package.lisp
> ===================================================================
> --- package.lisp	(revision 2)
> +++ package.lisp	(working copy)
> @@ -4,4 +4,4 @@
>  	   rgba alpha 
>  	   hsv hue saturation value
>  	   rgb->hsv hsv->rgb ->hsv ->rgb
> -	   convex-combination hue-combination rgb-combination hsv-combination))
> +	   convex-combination hue-combination rgb-combination rgba-combination hsv-combination))
> Index: colors.lisp
> ===================================================================
> --- colors.lisp	(revision 2)
> +++ colors.lisp	(working copy)
> @@ -161,6 +161,12 @@
>    (with-convex-combination (cc rgb1 rgb2 alpha)
>      (make-instance 'rgb :red (cc #'red) :green (cc #'green) :blue (cc #'blue))))
>  
> +
> +(defun rgba-combination (rgba1 rgba2 alpha)
> +  "Convex combination in RGBA space."
> +  (with-convex-combination (cc rgba1 rgba2 alpha)
> +    (make-instance 'rgba :red (cc #'red) :green (cc #'green) :blue (cc #'blue) :alpha (cc #'alpha))))
> +
>  (defun hsv-combination (hsv1 hsv2 alpha positivep)
>    (with-convex-combination (cc hsv1 hsv2 alpha)
>      (make-instance 'hsv

> _______________________________________________
> cl-colors-devel mailing list
> cl-colors-devel at common-lisp.net
> http://common-lisp.net/cgi-bin/mailman/listinfo/cl-colors-devel




More information about the Cl-colors-devel mailing list