ColorExtensionsDarken Method

Darkens a Color by increasing its RGB values by the specified percentage.

Definition

Namespace: DevCase.Extensions.ColorExtensions
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static Color Darken(
	this Color color,
	float percent
)

Parameters

color  Color
The source Color.
percent  Single
The percentage by which to darken the source color.

If percent is 1.0F (100%), the returned color will be Black.

Return Value

Color
A Color with its RGB values increased by the specified percentage.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Color. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Exceptions

ArgumentOutOfRangeException

See Also