Created
November 2, 2018 05:05
-
-
Save felipecustodio/50facecb329af1114bf286cd118a2d21 to your computer and use it in GitHub Desktop.
Get random colors from color matrix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| color[][] colors = { {#f7f4e3,#f9c4aa}, | |
| {#fcd77f,#ff2e4c} | |
| {#fcac0c,#ececec} | |
| }; | |
| void mouseClicked() { | |
| // get random colorscheme | |
| // (and guarantee it's a new colorscheme) | |
| random_index = (int)random(colors.length); | |
| while (random_index == current_index) { | |
| random_index = (int)random(4); | |
| } | |
| current_index = random_index; | |
| background(colors[random_index][0]); | |
| fill(colors[random_index][1]); | |
| stroke(colors[random_index][1]); | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment