Exemple #1
0
        private void SetColor(alphatab.platform.model.Color color)
        {
            var    baseColor = Color.FromArgb(color.getR(), color.getG(), color.getB());
            double h, s, l;

            ColorTools.RGB2HSL(baseColor, out h, out s, out l);

            _startColor = ColorTools.HSL2RGB(h, System.Math.Max(0, System.Math.Min(1, s - 0.2)),
                                             System.Math.Max(0, System.Math.Min(1, l + 0.2)));
            _endColor = ColorTools.HSL2RGB(h, System.Math.Max(0, System.Math.Min(1, s - 0.2)),
                                           System.Math.Max(0, System.Math.Min(1, l - 0.2)));
        }
        private void SetColor(Platform.Model.Color color)
        {
            var    baseColor = Color.FromArgb(color.R, color.G, color.B);
            double h, s, l;

            ColorTools.RGB2HSL(baseColor, out h, out s, out l);

            _startColor = ColorTools.HSL2RGB(h, System.Math.Max(0, System.Math.Min(1, s - 0.2)),
                                             System.Math.Max(0, System.Math.Min(1, l + 0.2)));
            _endColor = ColorTools.HSL2RGB(h, System.Math.Max(0, System.Math.Min(1, s - 0.2)),
                                           System.Math.Max(0, System.Math.Min(1, l - 0.2)));
        }