Hi guys
I’m very new to processing and am creating a data visualisation from some excel spreadsheet data. The data is made up of strings (not numbers) and is pasted below.
I need to know how to write a code that says:
If the word “red” appears in column A, draw a red ellipse for every word in the columns/rows that comes after it. And then I need a line of code that changes so that when the word “orange” appears in column A, it draws orange ellipses for every word that comes after that and so on (going through all the colours in column A).
So, I think this is an “IF” function that will help me do this?
I’m hoping to end up with a series of bubbles that come up from the bottom of the screen one colour at a time as it runs through and reads all the rows in the sheet.
Here is my data so far. Any help would be very much appreciated.
//movingellipse
color[] rainbow = {#169499,#BF0C2B, #F14C13, #FFD418, #03A63C, #04117B, #400A34, #02173E, #421F02, #0B080B, #F2055C, #D9D0B1, #F8A602, #F1F0F1};
color[] palette = rainbow
String[] palette = {"Aqua","Red", "Orange", "Yellow", "Green", "Blue", "Purple", "Indigo", "Brown", "Black", "Pink", "Grey", "White"};
int y = 299;
void setup () {
size(600, 300);
background(#169499);
smooth();
colorCulture = new Table("colorCultures.tsv", "header");
rowCount = colorCultures.getRowCount();
println("rowCount = + rowCount);
}
void draw() {
background(#169499);
for (int row = 0; row < rowCount: row++) {
//String Red = colorCultures.getString (row, 0);
//stroke (#169499);
//ellipse (100, y, 50, 50);
//y = y - 1;
}