RGB

Bitmaps
Aptilis 1

RGB(Red, Green, Blue)

RGB returns an Aptilis colour index from three values that represent the intensities of red, green and blue respectively for the requested colour.
These values should be in the range 0..255. Any value inferior to 0 will be considered 0, and any value bigger than 255 will be considered to be 255.
Aptilis provides you with 256 colours and the index returned matches the closest available colour. If the colour returned is not good enough, (You know that when you have seen the graphic), you can always override Aptilis'es colour definitions with setColor. But by doing so, you might prevent the font anti-aliasing to work properly.

Return Value:
An Aptilis colour index.

Example:

b = createBitmap(90, 200)
if b = -1
print("Oops...\n")
else

clearBitmap(b, RGB(255, 255, 255))


printAt(b, 4, 20, "Red", RGB(255, 0, 0))
printAt(b, 4, 40, "Green", RGB(0, 255, 0))
printAt(b, 4, 60, "Blue", RGB(0, 0, 255))
printAt(b, 4, 80, "Yellow", RGB(255, 255, 0))



printAt(b, 4, 100, "HxRed", hexColor("FF0000"))
printAt(b, 4, 120, "HxGreen", hexColor("00ff00"))
printAt(b, 4, 140, "HxBlue", hexColor("0000FF"))
printAt(b, 4, 160, "HxYellow", hexColor("FFFF00"))
printAt(b, 4, 180, "HxMagenta", hexColor("FF00FF"))
printAt(b, 4, 199, "HxCyan", hexColor("00FFFF"))

saveGifFile("c:\\aptilis\\colors.gif", b)

end if
Result:

For more details see the Bitmap topic.