private static Color LightenColor(Color color, float lightFactor)
		{
			float fFactor = lightFactor;
			if ((double)fFactor > 1.0)
				--fFactor;
			return Color.FromRgb(LightenColorExtension.LightenColorComponent(color.R, fFactor), LightenColorExtension.LightenColorComponent(color.G, fFactor), LightenColorExtension.LightenColorComponent(color.B, fFactor));
		}
		public static Color Lighten(this Color originalColor, float lightFactor)
		{
			if (LightenColorExtension.TransformationNotNeeded(lightFactor))
				return originalColor;
			if (LightenColorExtension.RealBright(lightFactor))
				return Colors.White;
			if (LightenColorExtension.ShouldDarken(lightFactor))
				return LightenColorExtension.DarkenColor(originalColor, lightFactor);
			return LightenColorExtension.LightenColor(originalColor, lightFactor);
		}
Пример #3
0
 public override object ProvideValue(IServiceProvider serviceProvider)
 {
     return((object)LightenColorExtension.Lighten(this.Color, this.LightFactor));
 }