public override UnityEngine.Color GetColour(double x, double y)
        {
            // Read:
            Color colour = SourceModule.GetColour(x, y);

            // Get:
            float channel = HsvRgb.Luminance(colour.r, colour.g, colour.b);

            return(new Color(channel, channel, channel, 1f));
        }
        public override double GetValue(double x, double y)
        {
            // Read:
            Color colour = SourceModule.GetColour(x, y);

            // Get:
            float channel = HsvRgb.Luminance(colour.r, colour.g, colour.b);

            return(channel);
        }
Ejemplo n.º 3
0
        public override UnityEngine.Color GetColour(double x, double y)
        {
            float r = (float)x;
            float g = (float)Saturation.GetValue(x, y);
            float b = (float)Lightness.GetValue(x, y);

            HsvRgb.ToRgb(ref r, ref g, ref b);

            return(new UnityEngine.Color(r, g, b, 1f));
        }
Ejemplo n.º 4
0
        public override UnityEngine.Color GetColour(double x, double y)
        {
            // Read H:
            float h = (float)HueModule.GetValue(x, y);

            // Read S:
            float s = (float)SaturationModule.GetValue(x, y);

            // Read V:
            float v = (float)BrightModule.GetValue(x, y);

            // Convert to RGB:
            HsvRgb.ToRgb(ref h, ref s, ref v);

            // Now RGB.
            return(new Color(h, s, v, 1f));
        }
Ejemplo n.º 5
0
        public override UnityEngine.Color GetColour(double x, double y)
        {
            UnityEngine.Color col1 = SourceModule.GetColour(x, y);
            float             result;

            switch (Method)
            {
            case DesaturateMethod.YChannel:                     // HSY model

                result = HsyRgb.Luminance(col1.r, col1.g, col1.b);

                break;

            case DesaturateMethod.LChannel:                     // HSL model

                result = HslRgb.Luminance(col1.r, col1.g, col1.b);

                break;

            case DesaturateMethod.VChannel:                     // HSV model

                result = HsvRgb.Luminance(col1.r, col1.g, col1.b);

                break;

            default:
            case DesaturateMethod.Greyscale:                     // Greyscale RGB average

                result = (col1.r + col1.g + col1.b) / 3f;

                break;
            }

            // Grey colour:
            return(new Color(result, result, result, col1.a));
        }