Board index » cppbuilder » Assigning integers to colours
Alien Brain
![]() CBuilder Developer |
Assigning integers to colours2004-10-06 03:25:43 PM cppbuilder98 Hi, I am doing a Mandelbrot program and am using the following code to plot different colours depending upon the number of iterations. Form1->Canvas->Pixels[x][y]=(Graphics::TColor)iterations; The problem I have is that it will not display different colours as I have not assigned values to the different colours within the set, e.g. 1 = clRed, 2 = clBlue and so on. My maximum number of iterations is 50 so I don't want to write a big switch statement that somehow assigns a colour to a number. I don't know how even if I wanted to! :-) Can anyone help please? Simple code as although I understand C++, I am not skilled with the Borland components etc. Thanks. |