Oficina Framework  1.3
Games Framework
Color4 Struct Reference

A struct representing a color. More...

#include <OficinaTypes.hpp>

Public Member Functions

 Color4 ()
 Constructs a black color. More...
 
 Color4 (float r, float g, float b)
 Constructs a custom opaque color. More...
 
 Color4 (float r, float g, float b, float a)
 Constructs a custom color. More...
 
 Color4 (Color4 precolor, float a)
 Constructs a color from another, changing only the alpha value. More...
 
ColorM GetMask ()
 Gets the equivalent Color Mask of this color. More...
 

Static Public Member Functions

static Color4 MaskToColor4 (ColorM mask)
 Transforms a mask into a Color4. More...
 

Public Attributes

float r
 Red component, ranged 0.0f ~ 1.0f. More...
 
float g
 Green component, ranged 0.0f ~ 1.0f. More...
 
float b
 Blue component, ranged 0.0f ~ 1.0f. More...
 
float a
 Alpha component, ranged 0.0f ~ 1.0f. 1.0f is completely opaque. More...
 

Detailed Description

A struct representing a color.

Constructor & Destructor Documentation

◆ Color4() [1/4]

Color4::Color4 ( )

Constructs a black color.

◆ Color4() [2/4]

Color4::Color4 ( float  r,
float  g,
float  b 
)

Constructs a custom opaque color.

Parameters
rRed component to be given to the color, ranged 0.0f ~ 1.0f.
gGreen component to be given to the color, ranged 0.0f ~ 1.0f.
bBlue component to be given to the color, ranged 0.0f ~ 1.0f.

◆ Color4() [3/4]

Color4::Color4 ( float  r,
float  g,
float  b,
float  a 
)

Constructs a custom color.

Parameters
rRed component to be given to the color, ranged 0.0f ~ 1.0f.
gGreen component to be given to the color, ranged 0.0f ~ 1.0f.
bBlue component to be given to the color, ranged 0.0f ~ 1.0f.
aAlpha component to be given to the color, ranged 0.0f ~ 1.0f. Bigger value means more opaque.

◆ Color4() [4/4]

Color4::Color4 ( Color4  precolor,
float  a 
)

Constructs a color from another, changing only the alpha value.

Parameters
precolorColor to be based on.
aAlpha component to be given to the color, ranged 0.0f ~ 1.0f.

Member Function Documentation

◆ GetMask()

ColorM Color4::GetMask ( )

Gets the equivalent Color Mask of this color.

Returns
This color's equivalent color mask.

◆ MaskToColor4()

static Color4 Color4::MaskToColor4 ( ColorM  mask)
static

Transforms a mask into a Color4.

Returns
A Color4 containing the same components for the mask.

Member Data Documentation

◆ a

float Color4::a

Alpha component, ranged 0.0f ~ 1.0f. 1.0f is completely opaque.

◆ b

float Color4::b

Blue component, ranged 0.0f ~ 1.0f.

◆ g

float Color4::g

Green component, ranged 0.0f ~ 1.0f.

◆ r

float Color4::r

Red component, ranged 0.0f ~ 1.0f.


The documentation for this struct was generated from the following file: