Created
August 4, 2017 15:53
-
-
Save kasvith/5474a042c98a66717a0a377d1426d4a5 to your computer and use it in GitHub Desktop.
Manderbolt smooth color
This file contains 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
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