Skip to content

Instantly share code, notes, and snippets.

@kasvith
Last active August 5, 2017 05:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kasvith/9da7b8673a0e0595108fd0b59f8d5fa1 to your computer and use it in GitHub Desktop.
Save kasvith/9da7b8673a0e0595108fd0b59f8d5fa1 to your computer and use it in GitHub Desktop.
Manderbolt smooth color. Use LOG2 as Math.log(2); Use converged Z absolute
public Color getFractalColor(FractalPointData fractalPointData){
double mu = fractalPointData.getIterations() + 1 - Math.log(Math.log(fractalPointData.getConvergedAbsolute()/LOG2)/LOG2);
int red = (int)(Math.sin(redFrequency * mu + redChannelPhase) * 128f + 127f);
int green = (int)(Math.sin(greenFrequency * mu + greenChannelPhase) * 128f + 127f);
int blue = (int)(Math.sin(blueFrequency * mu + blueChannelPhase) * 128f + 127f);
red = Utils.Clamp(red, 0, 255);
green = Utils.Clamp(green, 0, 255);
blue = Utils.Clamp(blue, 0 , 255);
return new Color(red, green, blue);
}
@namila007
Copy link

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment