Example #1
0
            public void ToHSLWithWhiteReturnsCorrectValues()
            {
                var accent = new Color.RGB(255, 255, 255);
                var hsl    = accent.ToHSL();

                Assert.AreEqual(new Color.HSL(0, 0, 1), hsl);
            }
Example #2
0
            public void ToHSLWithAccentReturnsCorrectValues()
            {
                var accent = new Color.RGB(240, 150, 9);
                var hsl    = accent.ToHSL();

                Assert.AreEqual(new Color.HSL(36.6, 0.928, 0.488), hsl);
            }
Example #3
0
            public void ToHSLWithBlackReturnsCorrectValues()
            {
                var accent = new Color.RGB(0, 0, 0);
                var hsl    = accent.ToHSL();

                Assert.AreEqual(new Color.HSL(0, 0, 0), hsl);
            }
Example #4
0
        public EditColourViewModel(Color.RGB colour)
        {
            var hsl = colour.ToHSL();

            Hue        = hsl.H;
            Saturation = hsl.S;
            Lightness  = hsl.L;
        }