Skip to content

Instantly share code, notes, and snippets.

@trcio
Created November 10, 2015 01:04
Show Gist options
  • Save trcio/bc5317a390d4939a3af8 to your computer and use it in GitHub Desktop.
Save trcio/bc5317a390d4939a3af8 to your computer and use it in GitHub Desktop.
Saturate a color through an extension
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