Color Selector by emoc

Rupert Russell

Ballarat, Australia

  • Available
    Products
    45
  • Artist
    Notes

Apparel

Cases & Skins

Wall Art

Home Decor

Bags

Stationery

Artist's Description

Color Selector /* a little helper to select a HSB color range,

by emoc / 06/2009
http://www.openprocessing.org/sketch/4283

/* a little helper to select a HSB color range,
emoc / 06/2009
*/

PFont font;
int xOffset = 160;
int yOffset = 660;
color black, white;
color bg;
boolean switchBg = false;
float[] nb = new float16;

void setup() {
colorMode(HSB);
black = color(0,0,0);
white = color(0,0,255); // white in HSB
size(3800, 3800);
font = createFont(“arial”, 20);
textFont(font);
bg = black;
}

void draw() {
background(bg);

float x = 255;// map mouseX to saturation
float y = 255; // map mouseY to brightness

// draw all tints with these saturation & brightness properties

for (int i = 0; i < 16; i++) {
for (int j = 0; j < 16; j++) {

fill( i + (16 * j), x, y);
rect( i*160 + xOffset, j*160 + yOffset, 160, 160);
stroke(bg);
fill( i + (16 * j), 0, (y + 128)%255 );
fill(0);
text("H " + (i+(16*j)), (i*160) + xOffset + 20, 24 + j*160 + yOffset);

text("S " + (int)x, (i*160) + 20 + xOffset, 46 + j*160 + yOffset);

text("B " + (int)y, (i*160) + 20 + xOffset, 68 + j*160 + yOffset);
}
}
}

void keyPressed() {
save(“upload660.png”);
exit();
}

desktop tablet-landscape content-width tablet-portrait workstream-4-across phone-landscape phone-portrait
desktop tablet-landscape content-width tablet-portrait workstream-4-across phone-landscape phone-portrait

10% off

for joining the Redbubble mailing list

Receive exclusive deals and awesome artist news and content right to your inbox. Free for your convenience.