mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
Rename internal C++ Color struct to Color32 to help differentiate it from Colorf.
This commit is contained in:
+4
-4
@@ -135,18 +135,18 @@ ColorT<T> operator/(const ColorT<T> &a, T s)
|
||||
return tmp /= s;
|
||||
}
|
||||
|
||||
typedef ColorT<unsigned char> Color;
|
||||
typedef ColorT<unsigned char> Color32;
|
||||
typedef ColorT<float> Colorf;
|
||||
|
||||
inline Color toColor(Colorf cf)
|
||||
inline Color32 toColor32(Colorf cf)
|
||||
{
|
||||
return Color((unsigned char) (cf.r * 255.0f),
|
||||
return Color32((unsigned char) (cf.r * 255.0f),
|
||||
(unsigned char) (cf.g * 255.0f),
|
||||
(unsigned char) (cf.b * 255.0f),
|
||||
(unsigned char) (cf.a * 255.0f));
|
||||
}
|
||||
|
||||
inline Colorf toColorf(Color c)
|
||||
inline Colorf toColorf(Color32 c)
|
||||
{
|
||||
return Colorf(c.r / 255.0f, c.g / 255.0f, c.b / 255.0f, c.a / 255.0f);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user