Skip to content

Instantly share code, notes, and snippets.

@grkvlt
Created October 15, 2017 20:09
Show Gist options
  • Save grkvlt/b00d07b8bb50e5da52eff714efd9fe8e to your computer and use it in GitHub Desktop.
Save grkvlt/b00d07b8bb50e5da52eff714efd9fe8e to your computer and use it in GitHub Desktop.
Exploring Iterated Function Systems
int color = (int) (colour[p] * RGB24);
rgb[0] = (color >> 16) & 0xff;
rgb[1] = (color >> 8) & 0xff;
rgb[2] = (color >> 0) & 0xff;
if (render == Render.LOG_DENSITY_FLAME || render == Render.LOG_DENSITY_FLAME_INVERSE) {
float alpha = (float) (Math.log(density[p]) / density[p]);
alpha = (float) Math.pow(invert ? alpha : 1f - alpha, gamma);
rgb[0] *= alpha;
rgb[1] *= alpha;
rgb[2] *= alpha;
} else {
rgb[0] *= gray;
rgb[1] *= gray;
rgb[2] *= gray;
}
Color.RGBtoHSB(rgb[0], rgb[1], rgb[2], hsb);
g.setPaint(alpha(Color.HSBtoRGB(hsb[0],
unity().apply(hsb[1] * vibrancy).floatValue() * vibrancyLimit,
unity().apply(gray * vibrancy).floatValue() * vibrancyLimit),
octet().apply((int) (ratio * 255 * vibrancy))));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment