Kevin Song
I'm a student at UT (that's the one in Austin) who studies things.
Probably Processing's problem
R
G
B
G
R
R
G
B
R
+
=
R
G
B
R
+
G
=
R
G
Note: this isn't quite true! c.f. "Color is a mess"
Y
G
R
RGB
CYM(K)
Each pixel has three light elements: red, green, and blue.
Light element intensity ranges from 0 to 255
What color model is this?
Colors at full intensity can be a little much!
Processing includes a color selector for more intuitive color selection if you don't have access to a digital paint program (Tools > Color Selector)
A popular notation for writing down RGB colors. Each number 0-255 is encoded as a two-digit hex.
#bf5700
191,87,0
Hey, what color is this anyways?
Three 8-bit channels (RGB) makes for a 24-bit color space. Sometimes add a 4th channel for transparency (RGBA).
Allows us to represent 16,777,216 different colors. Humans can see around 10 million colors.
Does not actually cover all colors humans can see!
For true color, we store 8 bits of information per color (0-255), or 24 bits per pixel.
$$24 \frac{\text{bits}}{\text{pixel}} \times \left( 1920 \times 1080 \frac{\text{pixel}}{\text{frame}}\right) \times 60 \frac{\text{frames}}{\text{second}} = $$
2,985,984,000 bits/second
Use different number of bits to store color data! If we only use 8 bits per pixel, we can store 1/3rd the data relative to true color.
True Color (24 bits)
Various image formats have different color and transparency depths.
background(int red, int green, int blue)
sets the color of the window in terms of RGBfill(int red, int green, int blue)
sets the color for any subsequent shape primitivesfill(int red, int green, int blue, int alpha)
includes a transparency channel to modify opacitycolor
primitiveProcessing has a special type for color:
color(float red, float green, float blue);
We can store it and use it in functions that expect color.
color yellow = color(255.0, 255.0, 0.0);
fill(yellow);
rect(0, 0, 200, 200);
// Processing also accepts color hexes!
color burnt_orange = #bf5700;
void draw(){
background(255,0,0);
background(0,255,0);
background(0,0,255);
}
blendMode(BLEND)
What operation is happening here? It isn't an add...
color
primitives in an array for re-use (make at least 4 colors). Use the color picker (Tools > Color Selector) if you don't have any ideas off the top of your head.fill()
and stroke()
.blendMode()
to affect color interactions with transparent colors. Show at least one example of how a different blendMode()
can result in a different behavior. Remember that mode calls only affect the draws that occur after them!By Kevin Song
I'm a student at UT (that's the one in Austin) who studies things.