Floating point color description class (for float). More...
#include <color.h>
Public Member Functions | |
| Colorf () | |
| Constructs a color. | |
| Colorf (const Color &color) | |
| Colorf (const float *array_rgba) | |
| Constructs a color. | |
| Colorf (const std::string &hexstr) | |
| Constructs a color. | |
| Colorf (const Vec4f &color) | |
| Constructs a color. | |
| Colorf (float r, float g, float b, float a=1.0f) | |
| Constructs a color. | |
| Colorf (int r, int g, int b, int a=255) | |
| Constructs a color. | |
| Colorf (unsigned char r, unsigned char g, unsigned char b, unsigned char a=255) | |
| Constructs a color. | |
| float | get_alpha () const |
| Get Alpha. | |
| float | get_blue () const |
| Get Blue. | |
| float | get_green () const |
| Get Green. | |
| float | get_red () const |
| Get Red. | |
| void | normalize () |
| Normalize the color by ensuring that all color values lie inbetween (0.0, 1.0). | |
| operator Color () const | |
| Type conversion operator. | |
| bool | operator!= (const Colorf &c) const |
| Color != Color operator (deep compare). | |
| bool | operator== (const Colorf &c) const |
| Color == Color operator (deep compare). | |
| void | set_alpha (float value) |
| Set alpha color component, in the range 0-1. | |
| void | set_blue (float value) |
| Set blue color component, in the range 0-1. | |
| void | set_green (float value) |
| Set green color component, in the range 0-1. | |
| void | set_red (float value) |
| Set red color component, in the range 0-1. | |
| Public Member Functions inherited from clan::Vec4< float > | |
| Vec4 () | |
| Vec4 (const float &p1, const float &p2, const float &p3, const float &p4) | |
| Vec4 (const float &p1, const float &p2, const Vec2< float > ©34) | |
| Vec4 (const float &scalar) | |
| Vec4 (const float *array_xyzw) | |
| Vec4 (const Vec2< float > ©, const float &p3, const float &p4) | |
| Vec4 (const Vec2< float > ©, const Vec2< float > ©34) | |
| Vec4 (const Vec3< float > ©, const float &p4) | |
| Vec4 (const Vec4< float > ©)=default | |
| Vec4 (const Vec4< OtherType > ©) | |
| Vec4 (const Vec4< OtherType > ©) | |
| Angle | angle3 (const Vec4< float > &vector) const |
| Calculate the angle between this vector and an other vector (not taking into account the w ordinate). | |
| Vec4< float > & | cross3 (const Vec4< float > &vector) |
| Calculate the cross product between this vector and an other vector (not taking into account the w ordinate). | |
| float | distance3 (const Vec4< float > &vector) const |
| Calculate the distance between this vector and an other vector (not taking into account the w ordinate). | |
| float | distance4 (const Vec4< float > &vector) const |
| Calculate the distance between this vector and an other vector (taking into account the w ordinate). | |
| float | dot3 (const Vec4< float > &vector) const |
| Dot products this vector with an other vector (not taking into account the w ordinate). | |
| float | dot4 (const Vec4< float > &vector) const |
| Dot products this vector with an other vector (taking into account the w ordinate). | |
| bool | is_equal (const Vec4< float > &other, float epsilon) const |
| Returns true if equal within the bounds of an epsilon. | |
| float | length3 () const |
| double | length3 () const |
| float | length3 () const |
| Returns the length (magnitude) of this vector (not taking into account the w ordinate). | |
| float | length4 () const |
| double | length4 () const |
| float | length4 () const |
| Returns the length (magnitude) of this vector (taking into account the w ordinate). | |
| Vec4< float > & | normalize3 () |
| Normalizes this vector (not taking into account the w ordinate). | |
| Vec4< float > & | normalize4 () |
| Normalizes this vector (taking into account the w ordinate). | |
| bool | operator!= (const Vec4< float > &vector) const |
| != operator. | |
| void | operator*= (const Vec4< float > &vector) |
| *= operator. | |
| void | operator*= (float value) |
| *= operator. | |
| void | operator+= (const Vec4< float > &vector) |
| += operator. | |
| void | operator+= (float value) |
| += operator. | |
| Vec4< float > | operator- () const |
| |
| void | operator-= (const Vec4< float > &vector) |
| -= operator. | |
| void | operator-= (float value) |
| -= operator. | |
| void | operator/= (const Vec4< float > &vector) |
| /= operator. | |
| void | operator/= (float value) |
| /= operator. | |
| bool | operator< (const Vec4< float > &vector) const |
| < operator. | |
| Vec4< float > & | operator= (const Vec4< float > &vector)=default |
| = operator. | |
| bool | operator== (const Vec4< float > &vector) const |
| == operator. | |
| Vec4< float > & | rotate3 (const Angle &angle, const Vec4< float > &axis) |
| Rotate this vector around an axis. Same as glRotate[f|d](angle, a);. | |
| Vec4< float > & | round () |
| Rounds all components on this vector. | |
| void | set_xy (const Vec2< float > &new_v) |
| void | set_zw (const Vec2< float > &new_v) |
Static Public Member Functions | |
| static bool | find_color (const std::string &name, Colorf &out_color) |
| Find and returns the static color matching a string. | |
| Static Public Member Functions inherited from clan::Vec4< float > | |
| static Vec4< float > | cross3 (const Vec4< float > &vector1, const Vec4< float > &vector2) |
| Calculate the cross product between two vectors (not taking into account the w ordinate). | |
| static float | dot3 (const Vec4< float > &vector1, const Vec4< float > &vector2) |
| Dot products between two vectors (not taking into account the w ordinate). | |
| static float | dot4 (const Vec4< float > &vector1, const Vec4< float > &vector2) |
| Dot products between two vectors (taking into account the w ordinate). | |
| static bool | is_equal (const Vec4< float > &first, const Vec4< float > &second, float epsilon) |
| Returns true if equal within the bounds of an epsilon. | |
| static Vec4< float > | normalize3 (const Vec4< float > &vector) |
| Normalizes a vector (not taking into account the w ordinate). | |
| static Vec4< float > | normalize4 (const Vec4< float > &vector) |
| Normalizes a vector (taking into account the w ordinate). | |
| static Vec4< float > | rotate3 (const Vec4< float > &vector, const Angle &angle, const Vec4< float > &axis) |
| Rotate a vector around an axis. Same as glRotate[f|d](angle, a);. | |
| static Vec4< float > | round (const Vec4< float > &vector) |
| Rounds all components on a vector. | |
Additional Inherited Members | |
| Public Types inherited from clan::Vec4< float > | |
| typedef float | datatype |
| Public Attributes inherited from clan::Vec4< float > | |
| union clan::Vec4:: { ... } | |
| union clan::Vec4:: { ... } | |
| union clan::Vec4:: { ... } | |
| union clan::Vec4:: { ... } | |
Floating point color description class (for float).
|
inline |
Constructs a color.
Referenced by clan::StandardColorf::aliceblue(), clan::StandardColorf::antiquewhite(), clan::StandardColorf::aqua(), clan::StandardColorf::aquamarine(), clan::StandardColorf::azure(), clan::StandardColorf::beige(), clan::StandardColorf::bisque(), clan::StandardColorf::black(), clan::StandardColorf::blanchedalmond(), clan::StandardColorf::blue(), clan::StandardColorf::blueviolet(), clan::StandardColorf::brown(), clan::StandardColorf::burlywood(), clan::StandardColorf::cadetblue(), clan::StandardColorf::chartreuse(), clan::StandardColorf::chocolate(), clan::StyleGetValue::color(), clan::StandardColorf::coral(), clan::StandardColorf::cornflowerblue(), clan::StandardColorf::cornsilk(), clan::StandardColorf::crimson(), clan::StandardColorf::cyan(), clan::StandardColorf::darkblue(), clan::StandardColorf::darkcyan(), clan::StandardColorf::darkgoldenrod(), clan::StandardColorf::darkgray(), clan::StandardColorf::darkgreen(), clan::StandardColorf::darkgrey(), clan::StandardColorf::darkkhaki(), clan::StandardColorf::darkmagenta(), clan::StandardColorf::darkolivegreen(), clan::StandardColorf::darkorange(), clan::StandardColorf::darkorchid(), clan::StandardColorf::darkred(), clan::StandardColorf::darksalmon(), clan::StandardColorf::darkseagreen(), clan::StandardColorf::darkslateblue(), clan::StandardColorf::darkslategray(), clan::StandardColorf::darkslategrey(), clan::StandardColorf::darkturquoise(), clan::StandardColorf::darkviolet(), clan::StandardColorf::deeppink(), clan::StandardColorf::deepskyblue(), clan::StandardColorf::dimgray(), clan::StandardColorf::dimgrey(), clan::StandardColorf::dodgerblue(), find_color(), clan::StandardColorf::firebrick(), clan::StandardColorf::floralwhite(), clan::StandardColorf::forestgreen(), clan::StandardColorf::fuchsia(), clan::StandardColorf::gainsboro(), clan::StandardColorf::ghostwhite(), clan::StandardColorf::gold(), clan::StandardColorf::goldenrod(), clan::StandardColorf::gray(), clan::StandardColorf::gray10(), clan::StandardColorf::gray20(), clan::StandardColorf::gray30(), clan::StandardColorf::gray40(), clan::StandardColorf::gray50(), clan::StandardColorf::gray60(), clan::StandardColorf::gray70(), clan::StandardColorf::gray80(), clan::StandardColorf::gray90(), clan::StandardColorf::green(), clan::StandardColorf::greenyellow(), clan::StandardColorf::grey(), clan::StandardColorf::honeydew(), clan::StandardColorf::hotpink(), clan::StandardColorf::indianred(), clan::StandardColorf::indigo(), clan::StandardColorf::ivory(), clan::StandardColorf::khaki(), clan::StandardColorf::lavender(), clan::StandardColorf::lavenderblush(), clan::StandardColorf::lawngreen(), clan::StandardColorf::lemonchiffon(), clan::StandardColorf::lightblue(), clan::StandardColorf::lightcoral(), clan::StandardColorf::lightcyan(), clan::StandardColorf::lightgoldenrodyellow(), clan::StandardColorf::lightgray(), clan::StandardColorf::lightgreen(), clan::StandardColorf::lightgrey(), clan::StandardColorf::lightpink(), clan::StandardColorf::lightsalmon(), clan::StandardColorf::lightseagreen(), clan::StandardColorf::lightskyblue(), clan::StandardColorf::lightslategray(), clan::StandardColorf::lightslategrey(), clan::StandardColorf::lightsteelblue(), clan::StandardColorf::lightyellow(), clan::StandardColorf::lime(), clan::StandardColorf::limegreen(), clan::StandardColorf::linen(), clan::StandardColorf::magenta(), clan::StandardColorf::maroon(), clan::StandardColorf::mediumaquamarine(), clan::StandardColorf::mediumblue(), clan::StandardColorf::mediumorchid(), clan::StandardColorf::mediumpurple(), clan::StandardColorf::mediumseagreen(), clan::StandardColorf::mediumslateblue(), clan::StandardColorf::mediumspringgreen(), clan::StandardColorf::mediumturquoise(), clan::StandardColorf::mediumvioletred(), clan::StandardColorf::midnightblue(), clan::StandardColorf::mintcream(), clan::StandardColorf::mistyrose(), clan::StandardColorf::moccasin(), clan::StandardColorf::navajowhite(), clan::StandardColorf::navy(), clan::StandardColorf::oldlace(), clan::StandardColorf::olive(), clan::StandardColorf::olivedrab(), operator!=(), operator==(), clan::StandardColorf::orange(), clan::StandardColorf::orangered(), clan::StandardColorf::orchid(), clan::StandardColorf::palegoldenrod(), clan::StandardColorf::palegreen(), clan::StandardColorf::paleturquoise(), clan::StandardColorf::palevioletred(), clan::StandardColorf::papayawhip(), clan::StandardColorf::peachpuff(), clan::StandardColorf::peru(), clan::StandardColorf::pink(), clan::StandardColorf::plum(), clan::StandardColorf::powderblue(), clan::StandardColorf::purple(), clan::StandardColorf::red(), clan::StandardColorf::rosybrown(), clan::StandardColorf::royalblue(), clan::StandardColorf::saddlebrown(), clan::StandardColorf::salmon(), clan::StandardColorf::sandybrown(), clan::StandardColorf::seagreen(), clan::StandardColorf::seashell(), clan::StandardColorf::sienna(), clan::StandardColorf::silver(), clan::StandardColorf::skyblue(), clan::StandardColorf::slateblue(), clan::StandardColorf::slategray(), clan::StandardColorf::slategrey(), clan::StandardColorf::snow(), clan::Brush::solid(), clan::Brush::solid_rgb8(), clan::Brush::solid_rgba8(), clan::StandardColorf::springgreen(), clan::StandardColorf::steelblue(), clan::StandardColorf::tan(), clan::StandardColorf::teal(), clan::StandardColorf::thistle(), clan::StandardColorf::tomato(), clan::StandardColorf::transparent(), clan::StandardColorf::turquoise(), clan::StandardColorf::violet(), clan::StandardColorf::wheat(), clan::StandardColorf::white(), clan::StandardColorf::whitesmoke(), clan::StandardColorf::yellow(), and clan::StandardColorf::yellowgreen().
|
inline |
Constructs a color.
Color components are specified in the range 0 to 1.
An alpha value of 0 means complete transparency, while 1 means completely opaque (solid).
| r | = Red color component. |
| g | = Green color component. |
| b | = Blue color component. |
| a | = Alpha (transparency) color component. |
|
inline |
Constructs a color.
Color components are specified in the range 0 to 1.
An alpha value of 0 means complete transparency, while 1 means completely opaque (solid).
| array_rgba | = Red,Green,Blue,Alpha color component. |
|
inline |
|
inline |
Constructs a color.
Color components are specified in the range 0 to 255.
An alpha value of 0 means complete transparency, while 255 means completely opaque (solid).
| r | = Red color component. |
| g | = Green color component. |
| b | = Blue color component. |
| a | = Alpha (transparency) color component. |
|
inline |
Constructs a color.
Color components are specified in the range 0 to 255.
An alpha value of 0 means complete transparency, while 255 means completely opaque (solid).
| r | = Red color component. |
| g | = Green color component. |
| b | = Blue color component. |
| a | = Alpha (transparency) color component. |
|
inlineexplicit |
References clan::color, get_alpha(), get_blue(), get_green(), and get_red().
|
inline |
Constructs a color.
| hexstr | The colors rgba components as a hexadecimal string of the format "#rrggbbaa", where the '#' and "aa" parts are optional. |
References find_color().
|
static |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Type conversion operator.
References clan::Color::Color().
|
inline |
|
inline |
|
inline |
Set alpha color component, in the range 0-1.
References clan::a.
|
inline |
Set blue color component, in the range 0-1.
References clan::b.
|
inline |
Set green color component, in the range 0-1.
References clan::g.
|
inline |
Set red color component, in the range 0-1.
References clan::r.
|
static |
rgb(240, 248, 255).
|
static |
rgb(250, 235, 215).
|
static |
rgb( 0, 255, 255).
|
static |
rgb(127, 255, 212).
|
static |
rgb(240, 255, 255).
|
static |
rgb(245, 245, 220).
|
static |
rgb(255, 228, 196).
|
static |
rgb( 0, 0, 0).
|
static |
rgb(255, 235, 205).
|
static |
rgb( 0, 0, 255).
|
static |
rgb(138, 43, 226).
|
static |
rgb(165, 42, 42).
|
static |
rgb(222, 184, 135).
|
static |
rgb( 95, 158, 160).
|
static |
rgb(127, 255, 0).
|
static |
rgb(210, 105, 30).
|
static |
rgb(255, 127, 80).
|
static |
rgb(100, 149, 237).
|
static |
rgb(255, 248, 220).
|
static |
rgb(220, 20, 60).
|
static |
rgb( 0, 255, 255).
|
static |
rgb( 0, 0, 139).
|
static |
rgb( 0, 139, 139).
|
static |
rgb(184, 134, 11).
|
static |
rgb(169, 169, 169).
|
static |
rgb( 0, 100, 0).
|
static |
rgb(169, 169, 169).
|
static |
rgb(189, 183, 107).
|
static |
rgb(139, 0, 139).
|
static |
rgb( 85, 107, 47).
|
static |
rgb(255, 140, 0).
|
static |
rgb(153, 50, 204).
|
static |
rgb(139, 0, 0).
|
static |
rgb(233, 150, 122).
|
static |
rgb(143, 188, 143).
|
static |
rgb( 72, 61, 139).
|
static |
rgb( 47, 79, 79).
|
static |
rgb( 47, 79, 79).
|
static |
rgb( 0, 206, 209).
|
static |
rgb(148, 0, 211).
|
static |
rgb(255, 20, 147).
|
static |
rgb( 0, 191, 255).
|
static |
rgb(105, 105, 105).
|
static |
rgb(105, 105, 105).
|
static |
rgb( 30, 144, 255).
|
static |
rgb(178, 34, 34).
|
static |
rgb(255, 250, 240).
|
static |
rgb( 34, 139, 34).
|
static |
rgb(255, 0, 255).
|
static |
rgb(220, 220, 220).
|
static |
rgb(248, 248, 255).
|
static |
rgb(255, 215, 0).
|
static |
rgb(218, 165, 32).
|
static |
rgb(128, 128, 128).
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
rgb( 0, 128, 0).
|
static |
rgb(173, 255, 47).
|
static |
rgb(128, 128, 128).
|
static |
rgb(240, 255, 240).
|
static |
rgb(255, 105, 180).
|
static |
rgb(205, 92, 92).
|
static |
rgb( 75, 0, 130).
|
static |
rgb(255, 255, 240).
|
static |
rgb(240, 230, 140).
|
static |
rgb(230, 230, 250).
|
static |
rgb(255, 240, 245).
|
static |
rgb(124, 252, 0).
|
static |
rgb(255, 250, 205).
|
static |
rgb(173, 216, 230).
|
static |
rgb(240, 128, 128).
|
static |
rgb(224, 255, 255).
|
static |
rgb(250, 250, 210).
|
static |
rgb(211, 211, 211).
|
static |
rgb(144, 238, 144).
|
static |
rgb(211, 211, 211).
|
static |
rgb(255, 182, 193).
|
static |
rgb(255, 160, 122).
|
static |
rgb( 32, 178, 170).
|
static |
rgb(135, 206, 250).
|
static |
rgb(119, 136, 153).
|
static |
rgb(119, 136, 153).
|
static |
rgb(176, 196, 222).
|
static |
rgb(255, 255, 224).
|
static |
rgb( 0, 255, 0).
|
static |
rgb( 50, 205, 50).
|
static |
rgb(250, 240, 230).
|
static |
rgb(255, 0, 255).
|
static |
rgb(128, 0, 0).
|
static |
rgb(102, 205, 170).
|
static |
rgb( 0, 0, 205).
|
static |
rgb(186, 85, 211).
|
static |
rgb(147, 112, 219).
|
static |
rgb( 60, 179, 113).
|
static |
rgb(123, 104, 238).
|
static |
rgb( 0, 250, 154).
|
static |
rgb( 72, 209, 204).
|
static |
rgb(199, 21, 133).
|
static |
rgb( 25, 25, 112).
|
static |
rgb(245, 255, 250).
|
static |
rgb(255, 228, 225).
|
static |
rgb(255, 228, 181).
|
static |
rgb(255, 222, 173).
|
static |
rgb( 0, 0, 128).
|
static |
rgb(253, 245, 230).
|
static |
rgb(128, 128, 0).
|
static |
rgb(107, 142, 35).
|
static |
rgb(255, 165, 0).
|
static |
rgb(255, 69, 0).
|
static |
rgb(218, 112, 214).
|
static |
rgb(238, 232, 170).
|
static |
rgb(152, 251, 152).
|
static |
rgb(175, 238, 238).
|
static |
rgb(219, 112, 147).
|
static |
rgb(255, 239, 213).
|
static |
rgb(255, 218, 185).
|
static |
rgb(205, 133, 63).
|
static |
rgb(255, 192, 203).
|
static |
rgb(221, 160, 221).
|
static |
rgb(176, 224, 230).
|
static |
rgb(128, 0, 128).
|
static |
rgb(255, 0, 0).
|
static |
rgb(188, 143, 143).
|
static |
rgb( 65, 105, 225).
|
static |
rgb(139, 69, 19).
|
static |
rgb(250, 128, 114).
|
static |
rgb(244, 164, 96).
|
static |
rgb( 46, 139, 87).
|
static |
rgb(255, 245, 238).
|
static |
rgb(160, 82, 45).
|
static |
rgb(192, 192, 192).
|
static |
rgb(135, 206, 235).
|
static |
rgb(106, 90, 205).
|
static |
rgb(112, 128, 144).
|
static |
rgb(112, 128, 144).
|
static |
rgb(255, 250, 250).
|
static |
rgb( 0, 255, 127).
|
static |
rgb( 70, 130, 180).
|
static |
rgb(210, 180, 140).
|
static |
rgb( 0, 128, 128).
|
static |
rgb(216, 191, 216).
|
static |
rgb(255, 99, 71).
|
static |
rgba(0, 0, 0, 0).
|
static |
rgb( 64, 224, 208).
|
static |
rgb(238, 130, 238).
|
static |
rgb(245, 222, 179).
|
static |
rgb(255, 255, 255).
|
static |
rgb(245, 245, 245).
|
static |
rgb(255, 255, 0).
|
static |
rgb(154, 205, 50).