Add support for rotated gradients

This commit is contained in:
2026-04-18 14:33:31 +02:00
parent 6dbf5a4812
commit b99fc39444
5 changed files with 136 additions and 2 deletions
+14
View File
@@ -121,6 +121,20 @@ class PD_API Color {
return *this;
}
/**
* Lerp
* @param v Target color
* @param t interpolation factor
* @return Class Reference
*/
constexpr Color& Lerp(const Color& v, float t) {
a = static_cast<u8>(a + (v.a - a) * t);
b = static_cast<u8>(b + (v.b - b) * t);
g = static_cast<u8>(g + (v.g - g) * t);
r = static_cast<u8>(r + (v.r - r) * t);
return *this;
}
/**
* Get 32Bit Color Value
* @return 32Bit Color Value (ABGR iirc)