i'm making a simple colouring program. the program uses a colorbar i made myself. the colorbar consists of 39 rgb colors.
i've filled a simple black & white picture with some colors (using floodfill). now comes the trickiest part..
i've loaded the original black and white picture in a TImage(image1). and i've loaded the painted picture in another TImage(image2). Now, when i try to color the original picture, my program checks if the color i'm using is the same as the color i used before (and that is now on image2).
i'm using canvas.pixels[x,y] to determine to color of the pixel at [x,y] on image2 and i compare it with the current brush color i'm about to use.
in some cases the colors match and that's, cuz that's what i want. but in a lot of cases the colors differ a little. e.g. color about to be used on image1 = rgb(130,189,140) while the original color(image2) = rgb(130,187,139). this doesnt match, thus is wrong.
the essence of the program is, that a color can only be used when it matches. remember i'm only using the 39 colors.
it's very frustating...
thanks in advance