The color() function does not seem to work as I would have assumed. When executing the code below I get the following output:
"rgba(255,255,255,1)
levels c1: 255,255,255,255
rgba(0,0,0,1)
levels c1: 0,0,0,255 "
I would expect the output to:
1. Be the same for both print calls
2. Be the actual HSB color I put in the color() function, i.e (141,0,0), a dark red.
What gives?
same code below
function setup() {
createCanvas(400, 400);
colorMode(HSB,360,100,100)
}
function draw() {
c1 = color('hsb(141,0,0)')
c2 = color(141,0,0)
print(c1 + "\nlevels c1: " + c1.levels)
print(c2 + "\nlevels c1: " + c2.levels)
noLoop()
}