BWAPI  4.1.2
An API for interacting with Starcraft: Broodwar (1.16.1)
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Modules
Public Member Functions | List of all members
BWAPI::Color Class Reference
Inheritance diagram for BWAPI::Color:
Inheritance graph

Public Member Functions

 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

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.
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.
int BWAPI::Color::green ( ) const

Retrieves the green component of the color.

Returns
integer containing the value of the green component.
int BWAPI::Color::blue ( ) const

Retrieves the blue component of the color.

Returns
integer containing the value of the blue component.