diff --git a/core/color.h b/core/color.h index 01e00faba..97cb7a3ed 100644 --- a/core/color.h +++ b/core/color.h @@ -194,6 +194,14 @@ struct _NO_DISCARD_CLASS_ Color { _FORCE_INLINE_ bool operator<(const Color &p_color) const; //used in set keys operator String() const; + static _FORCE_INLINE_ Color color8(int r, int g, int b) { + return Color(static_cast(r) / 255.0f, static_cast(g) / 255.0f, static_cast(b) / 255.0f); + } + + static _FORCE_INLINE_ Color color8(int r, int g, int b, int a) { + return Color(static_cast(r) / 255.0f, static_cast(g) / 255.0f, static_cast(b) / 255.0f, static_cast(a) / 255.0f); + } + /** * No construct parameters, r=0, g=0, b=0. a=255 */