Skip to content

Instantly share code, notes, and snippets.

@HakanL
Created December 29, 2015 23:13
Show Gist options
  • Save HakanL/5009f01edb3b8084ea08 to your computer and use it in GitHub Desktop.
Save HakanL/5009f01edb3b8084ea08 to your computer and use it in GitHub Desktop.
White out/Black out functionality
public static System.Drawing.Color AdjustColor(System.Drawing.Color input)
{
var hsv = new HSV(input);
// Test values for white out and black out
double whiteOut = 0.5;
double blackOut = 0.5;
hsv.Saturation = hsv.Saturation + (HSV.White.Saturation - hsv.Saturation) * whiteOut;
hsv.Value = Math.Min(1.0, hsv.Value + whiteOut) * (1 - blackOut);
return hsv.Color;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment