 |
Author |
Topic: default colorMode(HSB) values? (Read 250 times) |
|
rich

|
default colorMode(HSB) values?
« on: Oct 23rd, 2004, 6:37pm » |
|
RGB colorMode has default mode values of 255. Does anyone know the default values for HSB?
|
|
|
|
amoeba
|
Re: default colorMode(HSB) values?
« Reply #1 on: Oct 24th, 2004, 5:14am » |
|
I think you can assume it goes 0..255 as well. Unless you set it otherwise, or I'm much mistaken.
|
marius watz // amoeba http://processing.unlekker.net/
|
|
|
rich

|
Re: default colorMode(HSB) values?
« Reply #2 on: Oct 24th, 2004, 6:54pm » |
|
Actually, I think I just found out it's 360, 100, 100. At least that's the equivalent in Photoshop...
|
|
|
|
amoeba
|
Re: default colorMode(HSB) values?
« Reply #3 on: Oct 24th, 2004, 10:45pm » |
|
My apologies for not testing my assumption in my first post. However, I just did a sketch and it does in fact seem that the default values are 0..255. (Perhaps this should be in the reference - Casey?) The following code will render the full spectrum, with mouseY controlling the brightness: Code:void setup() { size(256,256); colorMode(HSB); } void loop() { noStroke(); for(int i=0; i<256; i++) { for(int j=0; j<256; j++) { stroke(i, j, 255-mouseY); point(i, j); } } } |
| However, if you want the behavior you mention, all you need to do is say: colorMode(HSB, 360,100,100);
|
marius watz // amoeba http://processing.unlekker.net/
|
|
|
fry
|
Re: default colorMode(HSB) values?
« Reply #4 on: Oct 24th, 2004, 11:00pm » |
|
yeah, if you switch to colorMode(HSB) it'll still be using the same values as before. so if you had: colorMode(RGB, 1); then calling colorMode(HSB); will still leave things as values from 0..1 and as amoeba pointed out, colorMode(HSB, 360, 100, 100) will give you photoshop-style colors.. this is the intent of colorMode() since we figure most people are familiar with different types of color settings (photoshop, illustrator, or 0..1 computer graphics style).
|
|
|
|
|