Add support for rotated gradients

This commit is contained in:
2026-09-06 16:16:41 +02:00
parent 78bf51b402
commit 3f4a590edf
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)