From the course: Processing: Interactive Data Visualization

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Understanding color attributes and functions

Understanding color attributes and functions - Processing Tutorial

From the course: Processing: Interactive Data Visualization

Start my 1-month free trial

Understanding color attributes and functions

Processing was created for graphical output and as such it has a number of ways of working with colors. In this movie, I'm going to show you just a very few things about how colors are specified in Processing. I'm going to start by just putting a little comment in here with the title of this sketch. I will create a window, 600x200, and I'll turn on anti-aliasing. I'll turn off strokes, no borders on the shapes. I'm going to be drawing a few rectangles. I'll be doing rectMode center in this particular case. And, then also I'll have a background that's dark gray. Let's see if we just draw that, wonderful. What I going to do now is I'm going to draw a few rectangles and I'm going to draw like this. Well actually, I'm going to use a few variables to specify where the rectangles go. The first one is how many rectangles do I want? In this particular case I want 4. And then I can use an equation to determine where the centers of each of those rectangles should be. When I want the shapes to…

Contents