Exemple #1
0
 private static Color GetFullContrastColor(Color color) {
     if (color.GetBrightness() > s_brightnessThreshold)
         return Color.Black;
     return Color.White;
 }
Exemple #2
0
 private static EdgeColorType GetContrastColorType(Color color, EdgeColorType colorType) {
     Debug.Assert(colorType == EdgeColorType.Contrast || colorType == EdgeColorType.EnhancedContrast);
     if (color.GetBrightness() > s_brightnessThreshold) {
         if (colorType == EdgeColorType.Contrast)
             return EdgeColorType.DarkerThanSurface;
         else 
             return EdgeColorType.DarkerDarkerThanSurface;
     }
     if (colorType == EdgeColorType.Contrast)
         return EdgeColorType.LighterThanSurface;
     else
         return EdgeColorType.LighterLighterThanSurface;
 }