@@ -36,43 +36,43 @@ class Color : public ::Color {
3636 /* *
3737 * Get Color structure from hexadecimal value
3838 */
39- Color (unsigned int hexValue) { set (::GetColor (hexValue)); }
39+ explicit Color (unsigned int hexValue) : ::Color (::GetColor(hexValue)) { }
4040
41- Color (void * srcPtr, int format) { set (::GetPixelColor (srcPtr, format)); }
41+ Color (void * srcPtr, int format) : ::Color (::GetPixelColor(srcPtr, format)) { }
4242
4343 /* *
4444 * Returns hexadecimal value for a Color
4545 */
46- int ToInt () const { return ::ColorToInt (*this ); }
46+ [[nodiscard]] int ToInt () const { return ::ColorToInt (*this ); }
4747
4848 /* *
4949 * Returns hexadecimal value for a Color
5050 */
51- operator int () const { return ::ColorToInt (*this ); }
51+ explicit operator int () const { return ::ColorToInt (*this ); }
5252
53- std::string ToString () const { return TextFormat (" Color(%d, %d, %d, %d)" , r, g, b, a); }
53+ [[nodiscard]] std::string ToString () const { return TextFormat (" Color(%d, %d, %d, %d)" , r, g, b, a); }
5454
55- operator std::string () const { return ToString (); }
55+ explicit operator std::string () const { return ToString (); }
5656
5757 /* *
5858 * Returns color with alpha applied, alpha goes from 0.0f to 1.0f
5959 */
60- Color Fade (float alpha) const { return ::Fade (*this , alpha); }
60+ [[nodiscard]] Color Fade (float alpha) const { return ::Fade (*this , alpha); }
6161
6262 /* *
6363 * Returns Color normalized as float [0..1]
6464 */
65- Vector4 Normalize () const { return ::ColorNormalize (*this ); }
65+ [[nodiscard]] Vector4 Normalize () const { return ::ColorNormalize (*this ); }
6666
6767 /* *
6868 * Returns Color from normalized values [0..1]
6969 */
70- Color (::Vector4 normalized) { set (::ColorFromNormalized (normalized)); }
70+ explicit Color (::Vector4 normalized) : Color (::ColorFromNormalized(normalized)) { }
7171
7272 /* *
7373 * Returns HSV values for a Color
7474 */
75- Vector3 ToHSV () const { return ::ColorToHSV (*this ); }
75+ [[nodiscard]] Vector3 ToHSV () const { return ::ColorToHSV (*this ); }
7676
7777 GETTERSETTER (unsigned char , R, r)
7878 GETTERSETTER (unsigned char , G, g)
@@ -206,7 +206,7 @@ class Color : public ::Color {
206206 /* *
207207 * Returns color with alpha applied, alpha goes from 0.0f to 1.0f
208208 */
209- Color Alpha (float alpha) const { return ::ColorAlpha (*this , alpha); }
209+ [[nodiscard]] Color Alpha (float alpha) const { return ::ColorAlpha (*this , alpha); }
210210
211211 Color Lerp (::Color color2, float factor) {
212212 return ::ColorLerp (*this , color2, factor);
@@ -215,7 +215,7 @@ class Color : public ::Color {
215215 /* *
216216 * Returns src alpha-blended into dst color with tint
217217 */
218- Color AlphaBlend (::Color dst, ::Color tint) const { return ::ColorAlphaBlend (dst, *this , tint); }
218+ [[nodiscard]] Color AlphaBlend (::Color dst, ::Color tint) const { return ::ColorAlphaBlend (dst, *this , tint); }
219219
220220 static Color LightGray () { return LIGHTGRAY; }
221221 static Color Gray () { return GRAY; }
0 commit comments