3434namespace raylib {
3535class Color : public ::Color {
3636 public:
37- Color (::Color color) {
38- r = color.r ;
39- g = color.g ;
40- b = color.b ;
41- a = color.a ;
37+ Color (const ::Color& color) {
38+ set (color);
4239 }
4340
4441 Color (unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha) :
4542 ::Color{red, green, blue, alpha} {};
43+
4644 Color (unsigned char red, unsigned char green, unsigned char blue) :
4745 ::Color{red, green, blue, 255 } {};
4846
@@ -61,7 +59,7 @@ class Color : public ::Color {
6159 /* *
6260 * Returns a Color from HSV values
6361 */
64- static Color FromHSV (float hue, float saturation, float value) {
62+ static :: Color FromHSV (float hue, float saturation, float value) {
6563 return ::ColorFromHSV (hue, saturation, value);
6664 }
6765
@@ -183,14 +181,19 @@ class Color : public ::Color {
183181 return *this ;
184182 }
185183
186- inline Color& DrawText (::Font font, const std::string& text, ::Vector2 position,
184+ inline Color& DrawText (const ::Font& font, const std::string& text, ::Vector2 position,
187185 float fontSize, float spacing) {
188186 ::DrawTextEx (font, text.c_str(), position, fontSize, spacing, *this);
189187 return *this ;
190188 }
191189
192- inline Color& DrawText (::Font font, const std::string& text, ::Rectangle rec, float fontSize,
193- float spacing, bool wordWrap = false ) {
190+ inline Color& DrawText (
191+ const ::Font& font,
192+ const std::string& text,
193+ ::Rectangle rec,
194+ float fontSize,
195+ float spacing,
196+ bool wordWrap = false ) {
194197 ::DrawTextRec (font, text.c_str(), rec, fontSize, spacing, wordWrap, *this);
195198 return *this ;
196199 }
@@ -239,6 +242,33 @@ class Color : public ::Color {
239242 return ::ColorAlphaBlend (dst, *this , tint);
240243 }
241244
245+ inline static Color LightGray () { return LIGHTGRAY; }
246+ inline static Color Gray () { return GRAY; }
247+ inline static Color DarkGray () { return DARKGRAY; }
248+ inline static Color Yellow () { return YELLOW; }
249+ inline static Color Gold () { return GOLD; }
250+ inline static Color Orange () { return ORANGE; }
251+ inline static Color Pink () { return PINK; }
252+ inline static Color Red () { return RED; }
253+ inline static Color Maroon () { return MAROON; }
254+ inline static Color Green () { return GREEN; }
255+ inline static Color Lime () { return LIME; }
256+ inline static Color DarkGreen () { return DARKGREEN; }
257+ inline static Color SkyBlue () { return SKYBLUE; }
258+ inline static Color Blue () { return BLUE; }
259+ inline static Color DarkBlue () { return DARKBLUE; }
260+ inline static Color Purple () { return PURPLE; }
261+ inline static Color Violet () { return VIOLET; }
262+ inline static Color DarkPurple () { return DARKPURPLE; }
263+ inline static Color Beige () { return BEIGE; }
264+ inline static Color Brown () { return BROWN; }
265+ inline static Color DarkBrown () { return DARKBROWN; }
266+ inline static Color White () { return WHITE; }
267+ inline static Color Black () { return BLACK; }
268+ inline static Color Blank () { return BLANK; }
269+ inline static Color Magenta () { return MAGENTA; }
270+ inline static Color RayWhite () { return RAYWHITE; }
271+
242272 protected:
243273 inline void set (const ::Color& color) {
244274 r = color.r ;
0 commit comments