Struct Color
D struct that wraps SDL_Color containing 4 bytes for storing color values of 3 color channels and 1 alpha
channel.
dsdl.Color stores unsigned byte-sized (0-255) red, green, blue color, and alpha channel values.
In total there are 16,777,216 possible color values. Combined with the alpha (transparency) channel, there
are 4,294,967,296 combinations.
Examples
auto red = dsdl.Color(255, 0, 0);
auto translucentRed = dsdl.Color(255, 0, 0, 128);
Constructors
| Name | Description |
this
(sdlColor)
|
Constructs a dsdl.Color from a vanilla SDL_Color from bindbc-sdl
|
this
(r, g, b, a)
|
Constructs a dsdl.Color by feeding in red, green, blue, and optionally alpha values
|
this
(rgb)
|
Constructs a dsdl.Color by feeding in an array of red, green, and blue, with alpha being 255
|
this
(rgba)
|
Constructs a dsdl.Color by feeding in an array of red, green, blue, and alpha
|
Fields
| Name | Type | Description |
sdlColor
|
sdl.pixels.SDL_Color | Internal SDL_Color struct
|
Properties
| Name | Type | Description |
a[get]
|
inout(ubyte) | Proxy to the alpha transparency value of the dsdl.Color
|
array[get]
|
inout(ubyte[4]) | Static array proxy of the dsdl.Color
|
b[get]
|
inout(ubyte) | Proxy to the blue color value of the dsdl.Color
|
g[get]
|
inout(ubyte) | Proxy to the green color value of the dsdl.Color
|
r[get]
|
inout(ubyte) | Proxy to the red color value of the dsdl.Color
|
Methods
| Name | Description |
toString
()
|
Formats the dsdl.Color into its construction representation: "dsdl.Color(<r>, <g>, <b>, <a>)"
|