Color

An RGB color structure.

Constructors

this
this(float red, float green, float blue)

Sets the RGB values, between 0 and 1.

this
this(Vec3f v)

Sets the RGB values, between 0 and 1.

this
this(int red, int green, int blue)

Sets the RGB values, between 0 and 255.

Members

Functions

load
void load(InStream stream)

Read from an InStream.

opBinary
Color opBinary(Color c)

Binary operations

opBinary
Color opBinary(float s)

Binary operations

opBinaryRight
Color opBinaryRight(float s)

Binary operations

opOpAssign
Color opOpAssign(Color c)

Binary operations

opOpAssign
Color opOpAssign(float s)

Assignment

save
void save(OutStream stream)

Write to an OutStream.

set
void set(float red, float green, float blue)

Sets the RGB values, between 0 and 1.

set
void set(int red, int green, int blue)

Sets the RGB values, between 0 and 255.

toSDL
SDL_Color toSDL()

Get the SDL struct format for colors.

Properties

b
float b [@property getter]
float b [@property setter]

Blue component, between 0 and 1.

g
float g [@property getter]
float g [@property setter]

Green component, between 0 and 1.

r
float r [@property getter]
float r [@property setter]

Red component, between 0 and 1.

random
Color random [@property getter]

Random RGB color.

rgb
Vec3f rgb [@property getter]

Convert to Vec3

rgb
Vec3f rgb [@property setter]

Convert from Vec3

Static functions

fromHex
Color fromHex(int rgbValue)

Take a 0xFFFFFF color format.

Static variables

black
Color black;
blue
Color blue;
cyan
Color cyan;
gray
Color gray;
green
Color green;
grey
Color grey;
lime
Color lime;
magenta
Color magenta;
maroon
Color maroon;
navy
Color navy;
olive
Color olive;
orange
Color orange;
pink
Color pink;
purple
Color purple;

Basic color.

red
Color red;
silver
Color silver;
teal
Color teal;
white
Color white;
yellow
Color yellow;

Basic color.

Meta