Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
cosmic latte gradients
void setup() {
size(640, 360);
colorMode(HSB, 360, 1, 1);
background(0);
}
void draw() {
clear();
for (int i=0; i<width; i++) {
color currentLatte = color(42, 0.094, 1);
for (int j=0; j<height; j++) {
float targetSat = .407;
float satVar = 0.3;
// vary on some saturation to make pretty colors
// color currentBlue = color(212, map(j, 0, height, targetSat - satVar, targetSat + satVar), 0.992);
// stroke(lerpColor(currentLatte, currentBlue, 0.5));
// or vary on the lerp param to make real gradients
color currentBlue = color(212, targetSat, 0.992);
stroke(lerpColor(currentLatte, currentBlue, map(j, 0, height, 0, 1)));
point(i, j);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.