Created
February 1, 2019 01:30
-
-
Save memish/956480d4faccbc7dbb843dd30729c673 to your computer and use it in GitHub Desktop.
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
int[] pr ={255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,80,80,80,235,235,5,235,255,255,255,255,255,255,255,255,80,235,80,235,235,235,5,235,235,235,255,255,255,255,255,255,80,235,80,80,235,235,235,5,235,235,235,255,255,255,255,255,255,80,235,235,235,235,5,5,5,5,255,255,255,255,255,255,255,255,235,235,235,235,235,235,255,255,255,255,255,255,255,255,255,255,255,0,255,255,0,255,255,255,255,255,255,255,255,255,255,255,255,0,255,255,0,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,0,255,0,0,255,0,255,255,255,255,255,255,255,255,255,255,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,0,0,0,255,255,0,0,0,255,255,255,255,255,255,255,100,100,100,255,255,255,255,100,100,100,255,255,255,255,255,100,100,100,100,255,255,255,255,100,100,100,100,255,255}; | |
int[] pg ={255,255,255,255,255,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,10,10,10,220,220,0,220,255,255,255,255,255,255,255,255,10,220,10,220,220,220,0,220,220,220,255,255,255,255,255,255,10,220,10,10,220,220,220,0,220,220,220,255,255,255,255,255,255,10,220,220,220,220,0,0,0,0,255,255,255,255,255,255,255,255,220,220,220,220,220,220,255,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,225,225,0,0,255,0,0,255,0,0,225,225,255,255,255,255,225,225,225,0,0,0,0,0,0,225,225,225,255,255,255,255,225,225,0,0,0,0,0,0,0,0,225,225,255,255,255,255,255,255,0,0,0,255,255,0,0,0,255,255,255,255,255,255,255,55,55,55,255,255,255,255,55,55,55,255,255,255,255,255,55,55,55,55,255,255,255,255,55,55,55,55,255,255}; | |
int[] pb ={255,255,255,255,255,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,5,5,5,0,0,0,0,255,255,255,255,255,255,255,255,5,0,5,0,0,0,0,0,0,0,255,255,255,255,255,255,5,0,5,5,0,0,0,0,0,0,0,255,255,255,255,255,255,5,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,0,0,255,0,0,255,0,0,255,255,255,255,255,255,255,0,0,0,255,0,0,255,0,0,0,255,255,255,255,255,0,0,0,0,255,255,255,255,0,0,0,0,255,255,255,255,0,0,0,255,0,255,255,0,255,0,0,0,255,255,255,255,0,0,0,255,255,255,255,255,255,0,0,0,255,255,255,255,0,0,255,255,255,255,255,255,255,255,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0,0,0,255,255,255,255,0,0,0,255,255,255,255,255,0,0,0,0,255,255,255,255,0,0,0,0,255,255}; | |
PImage myImg=null; | |
int gridSize = 16; | |
void setup() { | |
size(600, 300); | |
myImg = createImage(16, 16, RGB); | |
} | |
void draw() { | |
image(myImg, 0, 0); | |
} | |
void mousePressed(){ | |
changeImg(); | |
} | |
void changeImg(){ | |
myImg.loadPixels(); | |
for (int i = 0; i < gridSize*gridSize; i++) { | |
myImg.pixels[i] = color(pr[i], pg[i], pb[i]); | |
} | |
myImg.updatePixels(); | |
myImg.resize(0,200); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment