示例#1
0
文件: Util.cs 项目: renyh1013/dp2
 private static Color GetFullContrastColor(Color color) {
     if (color.GetBrightness() > s_brightnessThreshold)
         return Color.Black;
     return Color.White;
 }
示例#2
0
文件: Util.cs 项目: renyh1013/dp2
 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;
 }