Archived

This topic is now archived and is closed to further replies.

Coloring Fractals

This topic is 5016 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I''ve made a program to draw the Mandelbrot Fractal and I''m not sure how to color it properly. At the moment, I have made the maximum iteration for it 255, so the returned value will be 255 or less so it is able to be put into an RGB value easily. For example, if the iteration returned 178, the color would be R: 178, G: 178, B: 178. I''m interested to know how I would be able to make the fractals colorful like all the ones I have seen on webpages, etc. If anyone is able to tell me how to do this it would be great, by changing the max iteration and changing how it calculates the RGB values or something. Thanks in advance.

Share this post


Link to post
Share on other sites
just try and find different color palette on the web. oldschool programing resources that worked with 256 colors will have lots of examples.
you could build your own aswell.
basically a color table

int colors[256]; //fill this table with something cool, try playing with sin/cos functions

and then for each iteration just put colors[whatever] onto the screen.

Share this post


Link to post
Share on other sites