INNER CODE UNIT · C#

max

endlesstravel/Love2dCS · csharp_src/Love.Color.cs:106

            int max = Math.Max(Math.Max(r, g), b);

            return (max + min) / (byte.MaxValue * 2f);
        }

        public float GetHue()
        {
            if (r == g && g == b)
                return 0f;

            int min = Math.Min(Math.Min(r, g), b);
            int max = Math.Max(Math.Max(r, g), b);

            float delta = max - min;
            float hue;

            if (r == max)
                hue = (g - b) / delta;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…