Bug 432 : setting a gray color that's greater than the colorMode() can produce strange colors
Last modified: 2006-11-05 14:41




Status:
RESOLVED
Resolution:
LATER -
Priority:
P4
Severity:
normal

 

Reporter:
fry
Assigned To:
fry

Attachment Type Created Size Actions

Description:   Opened: 2006-11-05 06:32
for instance, this produces a dark blue background:

colorMode(RGB, 100);
background(128);

this is because it's messy to discern between: background(#FFCC00) and
background(200), because they both evaluate as int values. in some far-off
release of processing, we may be able to enforce a "real" color type that
would get around this. to differentiate between the two cases, fill(),
color(), background(), etc. use the current maximum values for the
colorMode(). so if the value coming into background() is greater than the
colorMax (in this case, 100), then it assumes that the value is probably a
hex color of format #ffcc00 or created with the color() function.
Additional Comment #1 From fry 2006-11-05 14:41
this is a cousin of bug #382.