Colour Bug RRS feed

  • General discussion

  • Trawling through the posted programs, I found mention of a bug discovered by Steven Don while creating his Mandelbrot program. He said,

    "Although a Mandelbrot drawing program was already posted, I figured I'd submit mine as well. It makes use of the new GraphicsWindow.GetColorFromRGB method in Small Basic 0.2 (and let me discover a bug in that as well: it seems to have errors in calculating the colour components so that 255 is counted as 0 [probably through a rounding error that results in 256])."

    This bug is still present in v0.3.1 so I have raised this as a new thread. The problem can be illustrated with the following code:-

    colour = GraphicsWindow.GetColorFromRGB(255,255,255)
    TextWindow.WriteLine("Colour = " + colour)
    GraphicsWindow.PenColor = colour
    GraphicsWindow.BrushColor = colour

    The colour shown in the text window is #000000 and the pen and brush colours are indeed black.
    Saturday, February 14, 2009 12:22 PM