b2cb80581e7951bb6a66fbf90f020a5d93ce2952 kent Wed Oct 12 14:32:35 2011 -0700 Adding some constants for hue/sat/value color spaces. diff --git src/inc/memgfx.h src/inc/memgfx.h index e62b967..0cdb625 100644 --- src/inc/memgfx.h +++ src/inc/memgfx.h @@ -344,30 +344,32 @@ void mgDrawPoly(struct memGfx *mg, struct gfxPoly *poly, Color color, boolean filled); /* Draw polygon, possibly filled in color. */ struct hslColor mgRgbToHsl(struct rgbColor rgb); /* Convert RGB to HSL colorspace (see http://en.wikipedia.org/wiki/HSL_and_HSV) * In HSL, Hue is the color in the range [0,360) with 0=red 120=green 240=blue, * Saturation goes from a shade of grey (0) to fully saturated color (1000), and * Lightness goes from black (0) through the hue (500) to white (1000). */ struct hsvColor mgRgbToHsv(struct rgbColor rgb); /* Convert RGB to HSV colorspace (see http://en.wikipedia.org/wiki/HSL_and_HSV) * In HSV, Hue is the color in the range [0,360) with 0=red 120=green 240=blue, * Saturation goes from white (0) to fully saturated color (1000), and * Value goes from black (0) through to the hue (1000). */ +#define hsvValMax 1000 +#define hsvSatMax 1000 struct rgbColor mgHslToRgb(struct hslColor hsl); /* Convert HSL to RGB colorspace (see http://en.wikipedia.org/wiki/HSL_and_HSV) */ struct rgbColor mgHsvToRgb(struct hsvColor hsv); /* Convert HSV to RGB colorspace (see http://en.wikipedia.org/wiki/HSL_and_HSV) */ struct rgbColor mgRgbTransformHsl(struct rgbColor in, double h, double s, double l); /* Transform rgb 'in' value using * hue shift 'h' (0..360 degrees), * saturation scale 's', and * lightness scale 'l' * Returns the transformed rgb value * Use H=0, S=L=1 for identity transformation */