(Formerly known as RawSetColorRGB, which is now obsolete)
static int Game.GetColorFromRGB(int red, int green, int blue)
Gets the AGS Colour Number for the specified RGB colour. The red, green and blue
components are values from 0 to 255. This function gives you a run-time equivalent
to the Colour Finder in the editor.
This command is slow in 256-colour games, since the palette has to be scanned to find the
nearest matching colour.
NOTE: This is a static function, and thus need to be called with Game. in front of it. See
the example below.
Example:
DrawingSurface *surface = Room.GetDrawingSurfaceForBackground();
surface.DrawingColor = Game.GetColorFromRGB(0, 255, 0);
surface.DrawLine(0, 0, 50, 50);
surface.Release();
will draw a bright green line onto the room background
See Also: DrawingSurface.DrawingColor
|