GetColorFromHex
1 2
| var color = Application.Current.Resources["SystemAccentColor"]; var accent = ColorHelper.GetColorFromHex(color.ToString());
|
ColorToUInt
1 2
| var colorInt = ColorHelper.ColorToUInt(Colors.Red);
|
GetHexFromColor
1 2
| var hex = ColorHelper.GetHexFromColor(Colors.Red);
|
GetSolidColorBrush
1 2
| var solidBrush = ColorHelper.GetSolidColorBrush(hex);
|
LightenColor
Tints the color by the given percent.
1
| Color ColorHelper.LightenColor(color, percent);
|
DarkenColor
Tints the color by the given percent.
1
| Color ColorHelper.DarkenColor(color, percent);
|
GetColorFromHsl
Converts the HSL values to a Color.
1
| Color ColorHelper.GetColorFromHsl(alpha, hue, saturation, lighting);
|
GetBrightnessFromColor
Gets the brightness of the color.
1
| float ColorHelper.GetBrightnessFromColor(color);
|
GetHueFromColor
Gets the hue of the color.
1
| float ColorHelper.GetHueFromColor(color);
|
GetSaturationFromColor
Gets the saturation of the color.
1
| float ColorHelper.GetSaturationFromColor(color);
|
Demo
you can run demo and see this feature.