Hey, so I have three sets of six colors each - a green set, blue set, and a brown set. I want to randomly select from one of these sets, and then randomly select a color from within that set to fill the first square in a grid.
I want the color of the second square in the grid to have a higher probability of coming from the same color set as the previous color did. So if the first color comes from the green set, I want there to be a 60% chance that the next color will also come from the green set, as opposed to 33% if it were random. Here is the code that I have written in an attempt to do this:
For some reason, this code only fills up part of the window with pixels, and the relationships between the colors is not visually apparent. I hope to generate recognizable relationships between the blues, greens and browns. I also want to fill the entire screen up in a solid grid of pixels instantly. Any thoughts are appreciated, I am new to this.
Hey, complete noob here. I'm trying to create a pixel grid that is composed of a set of preselected colors, and that randomly distributes these colors throughout the grid. here is some code that I have already written, hopefully this will help to illustrate what I am trying to do:
float x = 0;
while(x<width) {
float y = 0;
while(y<height) {
if (random(100)> 50) { //50% chance that the square will be grayscale