Created
November 10, 2015 01:04
-
-
Save trcio/bc5317a390d4939a3af8 to your computer and use it in GitHub Desktop.
Saturate a color through an extension
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class ColorExtensions | |
{ | |
public static Color Saturate(this Color color, float coef) | |
{ | |
return Color.FromArgb((int)(color.R * coef), (int)(color.G * coef), (int)(color.B * coef)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment