MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / Chroma

Function Chroma

TombEngine/Math/Utils.cpp:102–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100 }
101
102 float Chroma(const Vector3& color)
103 {
104 float r = color.x;
105 float g = color.y;
106 float b = color.z;
107
108 float maxVal = std::max({ r, g, b });
109 float minVal = std::min({ r, g, b });
110 float chroma = maxVal - minVal;
111
112 float normalizedChroma = (maxVal == 0.0f) ? 0.0f : (chroma / maxVal);
113 return normalizedChroma;
114 }
115
116 std::pair<std::array<int, 3>, std::array<int, 3>> GenerateColorShift(Vector3 mainColor, Vector3 additionalColor)
117 {

Callers 1

PrepareFiresMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected