duane/sketch — Issue #4: Unify color support
Author: duane
Created: 2011-10-17 17:49:48+00:00
State: open

Right now, sketch is limited by a severe lack of color options. There are two schemes, currently:

`background(ctx, v1, v2, v3)`—accepts RGB color values in the range of [0.0, 255.0]

`stroke/fill(ctx, v1, v2, v3)`—accepts RGB color values in the range of [0.0, 1.0].

Though I'm a fan of the [0.0, 1.0] color values—I think it's much more natural to think of colors in terms of that—I'm not willing to give up compatibility with processing at this moment. Also, grayscale/HSV/cmyk(?) values are not yet supported.

Proposal: fix stroke/fill and add the following functions:

`backgroundv/strokev/fillv(ctx, v)` - grayscale "value" colors
`background/stroke/fill(ctx, v1, v2, v3)` - RGB/HSV colors
`backgrounda/strokea/filla(ctx, v1, v2, v3, a)` - RGBA/HSVA

`colorMode(ctx, mode)`
`colorModev(ctx, mode, range)`
`colorModec(ctx, mode, range1, range2, range3)` - not sure if `c` will be the appropriate suffix.
`colorModea(ctx, mode, range1, range2, range3, rangea)`