Jump to content
  • Advertisement


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


Coloring Fractals

This topic is 5317 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

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!