MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / saturation

Method saturation

source/core/StarColor.cpp:378–392  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

376}
377
378float Color::saturation() const {
379 // Min. value of RGB
380 float var_min = min(min(m_data[0], m_data[1]), m_data[2]);
381
382 // Max. value of RGB
383 float var_max = max(max(m_data[0], m_data[1]), m_data[2]);
384
385 // Delta RGB value
386 float del_max = var_max - var_min;
387
388 if (del_max == 0.0f) { // This is a gray, no chroma...
389 return 0.0f;
390 } else
391 return del_max / var_max;
392}
393
394float Color::value() const {
395 return max(max(m_data[0], m_data[1]), m_data[2]);

Callers 4

renderObjectPreviewsMethod · 0.80
beamDrawablesMethod · 0.80
renderWireMethod · 0.80
processSaturationShiftFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected