Q:

C# Colour Cycling MandleBrot Fractal

I am designing a Mandlebrot Fractal in C# which is working fine... Question is I want to cycle through all the rgb colours in effect what I think is called colour cycling... I know that I would need to convert the bitmap to a pallet and hence run through  each pixel???? How would I achieve this?? Working on this for hours now and really unsure.
Thanks

A:

Using HSV instead of RGB would probably make cycling the colors a lot easier, since you just increment (and modulo) a single value instead of trying to manage 3 of them.

A:

Agree with @Pyritie, use HSV rather than RGB.
See this question for examples.
Then try this code to set palette colours of a bitmap:
var bitmap = new Bitmap(width, height, width, PixelFormat.Format8bppIndexed);

ColorPalette palette = bitmap.Palette;
palette.Entries[0] = Color.Black;
for (int i = 1; i < 256; i++)
{
    // set to whatever colour here...
    palette.Entries[i] = Color.FromArgb((i * 7) % 256, (i * 7) % 256, 255);
}
bitmap.Palette = palette;

Original credit belongs to Jon Skeet, from a TPL demo of his, I think.

