EnsureColorTable() private static method

private static EnsureColorTable ( ) : void
return void
Exemplo n.º 1
0
 public static int KnownColorToArgb(KnownColor color)
 {
     KnownColorTable.EnsureColorTable();
     if (color <= KnownColor.MenuHighlight)
     {
         return(KnownColorTable.colorTable[(int)color]);
     }
     return(0);
 }
Exemplo n.º 2
0
 public static Color ArgbToKnownColor(int targetARGB)
 {
     KnownColorTable.EnsureColorTable();
     for (int i = 0; i < KnownColorTable.colorTable.Length; i++)
     {
         if (KnownColorTable.colorTable[i] == targetARGB)
         {
             Color result = Color.FromKnownColor((KnownColor)i);
             if (!result.IsSystemColor)
             {
                 return(result);
             }
         }
     }
     return(Color.FromArgb(targetARGB));
 }