BWAPI  4.2.0
An API for interacting with Starcraft: Broodwar (1.16.1)
Public Member Functions | List of all members
BWAPI::Color Class Reference
Inheritance diagram for BWAPI::Color:
Inheritance graph

Public Member Functions

constexpr Color (int id=0)
 Color (int red, int green, int blue)
int blue () const
int green () const
int red () const

Detailed Description

The Color object is used in drawing routines to specify the color to use.

Note
Starcraft uses a 256 color palette for rendering. Thus, the colors available are limited to this palette.
See also
Colors

Constructor & Destructor Documentation

constexpr BWAPI::Color::Color (int id = 0)

A constructor that uses the color at the specified palette index.

Parameters
idThe index of the color in the 256-color palette.

References blue(), green(), and red().

BWAPI::Color::Color (int red, int green, int blue )

A constructor that uses the color index in the palette that is closest to the given rgb values.

On its first call, the colors in the palette will be sorted for fast indexing.

Note
This function computes the distance of the RGB values and may not be accurate.
Parameters
redThe amount of red.
greenThe amount of green.
blueThe amount of blue.

Member Function Documentation

int BWAPI::Color::red () const

Retrieves the red component of the color.

Returns
integer containing the value of the red component.

Referenced by Color().

int BWAPI::Color::green () const

Retrieves the green component of the color.

Returns
integer containing the value of the green component.

Referenced by Color().

int BWAPI::Color::blue () const

Retrieves the blue component of the color.

Returns
integer containing the value of the blue component.

Referenced by Color().