Пример #1
0
 public static Color ToColor(this ModelColor cl)
 {
     unchecked
     {
         return(Color.FromArgb((int)cl.Argb));
     }
 }
Пример #2
0
        ModelColor AdjustColor(ModelColor color)
        {
            switch (paletteBrightness)
            {
            case PaletteBrightness.Increased:
                return(color.MakeLighter(22));

            case PaletteBrightness.Decreased:
                return(color.MakeDarker(16));

            default:
                return(color);
            }
        }
Пример #3
0
        public int?FindColor(ModelColor color)
        {
            int ret = 0;

            foreach (int cl in colors)
            {
                if (color.Argb == FromRGB(cl).Argb)
                {
                    return(ret);
                }
                ret++;
            }
            return(null);
        }
Пример #4
0
 public ColorTableEntry(int id, ModelColor cl)
 {
     ID    = id;
     Color = cl;
 }
Пример #5
0
 public static string ToHtmlColor(this ModelColor cl)
 {
     return(string.Format("#{0:x6}", cl.Argb & 0xffffff));
 }