Beispiel #1
0
        public ColorCollection(ISettings settings)
        {
            var setting = settings.Get <string>("core.colors");

            if (setting != null)
            {
                var customColors = setting.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
                foreach (var c in customColors)
                {
                    var parts = c.Split(new[] { ':' }, StringSplitOptions.RemoveEmptyEntries);
                    colors.Add(parts[0], ColorFormatter.FromHexString(parts[1]));
                }
            }
        }
        private static string ConvertColor(string value, TimetableVersion version)
        {
            var mcolor = ColorFormatter.FromString(value, null);

            return(ColorFormatter.ToString(mcolor, version == TimetableVersion.JTG2_x));
        }
Beispiel #3
0
 public string ToName(MColor color)
 => colors.FirstOrDefault(c => c.Value == color).Key ?? ColorFormatter.ToString(color);