Use String as Fill() data
in
Programming Questions
•
5 months ago
Hi all,
Relatively new to Processing and forums and I have a question about Strings and Fill. I am loading a text file containing data such as:
139,138,132
83,86,95
145,116,124
160,103,111
I can successfully load that string data as an array and print it while running in the draw() function, but I'd like to use those strings to control the fill() command when creating shapes. I think the problem is using a string for the fill. The error I receive is: "The method fill(int) in the type PApplet is not applicable for the arguments (String)". Here is the code:
- void draw() {
- String colorListData[] = loadStrings("testData.txt");
- for (int i = 0 ; i < colorListData.length; i++) {
- fill(colorListData[i]);
- rect (0, int(random(0,999)), width, 5);
- }
Any help would be very appreciated! Thank you!
1