Last active
August 5, 2017 05:41
-
-
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
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
👍