Skip to content

Instantly share code, notes, and snippets.

@kasvith
Created August 4, 2017 15:53
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/1fd0ef04d653ab71efe1acfce85b07ef to your computer and use it in GitHub Desktop.
Save kasvith/1fd0ef04d653ab71efe1acfce85b07ef to your computer and use it in GitHub Desktop.
Manderbolt smooth color
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);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment