| 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 | { |