Exemplo n.º 1
0
        private void settingsLoadedEventHandler(object sender, SettingsLoadedEventArgs e)
        {
            string[] colorInts = ColorsString.Split(',');
            for (int i = 0; i < colorInts.Length; i++)
            {
                if (i < colorInts.Length / 2)
                {
                    _minColors[i] = Color.FromArgb(Int32.Parse(colorInts[i]));
                }
                else
                {
                    _maxColors[i - _minColors.Length] = Color.FromArgb(Int32.Parse(colorInts[i]));
                }
            }

            for (int i = 0; i < colorInts.Length; i++)
            {
                if (i < colorInts.Length / 2)
                {
                    _uploadedMinColors[i] = Color.FromArgb(Int32.Parse(colorInts[i]));
                }
                else
                {
                    _uploadedMaxColors[i - _uploadedMinColors.Length] = Color.FromArgb(Int32.Parse(colorInts[i]));
                }
            }
        }
        public List <Color> GetColors()
        {
            if (ColorsList != null)
            {
                return(ColorsList);
            }

            var hex = ColorsString.Split(',');

            return(hex.Select(t => Color.FromHex(t.Trim())).ToList());
        }
Exemplo n.º 3
0
 public void GivenColorsStringIsIncorrect_ShouldReturnValid(string colors)
 {
     Assert.True(ColorsString.IsValid(colors));
 }