Normalize color storage

Colors are now normalized to 0 - 1 values instead of 0 - 255

causes calculations to be simpler and generally cleans up the codebase.
This commit is contained in:
vaxerski
2023-01-05 19:25:45 +01:00
parent 0e3547e0f6
commit 96198dae55
18 changed files with 71 additions and 72 deletions

View File

@@ -8,12 +8,12 @@ class CColor {
CColor(float, float, float, float);
CColor(uint64_t);
float r = 0, g = 0, b = 0, a = 255;
float r = 0, g = 0, b = 0, a = 1.f;
uint64_t getAsHex();
CColor operator-(const CColor& c2) const {
return CColor(r - c2.r, g - c2.g, b - c2.b, a - c2.a);
return CColor(r - c2.r, g - c2.g, b - c2.b, a - c2.a);
}
CColor operator+(const CColor& c2) const {