array for 0 to 255 colors
in
Programming Questions
•
5 months ago
I try to make a simple "image", I want an array with 255 columns and 1 line for every color from 0 to 255.
I try that way. but i'm sure their is a better and faster.
Any ideas how can do that?
- background(155);
- size(500, 200);
- rect(10, 10, 20, 70);
- fill(255); //black
- rect(30, 10, 20, 70);
- fill(254); //black
- rect(50, 10, 20, 70);
- fill(253); //black
- rect(70, 10, 20, 70);
- fill(252); //black
- rect(90, 10, 20, 70);
- fill(251); //black
- rect(110, 10, 20, 70);
- fill(250); //black
- rect(130, 10, 20, 70);
- fill(249); //black
- rect(150, 10, 20, 70);
- fill(248); //black
- rect(170, 10, 20, 70);
- fill(247); //black
- rect(190, 10, 20, 70);
- fill(246); //black
- rect(210, 10, 20, 70);
- fill(245); //black
- rect(230, 10, 20, 70);
- fill(244); //black
- rect(250, 10, 20, 70);
- fill(243); //black
- rect(270, 10, 20, 70);
- fill(242); //black
- rect(290, 10, 20, 70);
- fill(241); //black
- rect(310, 10, 20, 70);
- fill(240); //black
- rect(330, 10, 20, 70);
- fill(239); //black
- rect(350, 10, 20, 70);
- fill(238); //black
- rect(370, 10, 20, 70);
- fill(237); //black
- rect(390, 10, 20, 70);
- fill(236); //black
- rect(410, 10, 20, 70);
- fill(235); //black
- rect(430, 10, 20, 70);
- fill(234); //black
- rect(450, 10, 20, 70);
- fill(0); //black
1