Created
December 29, 2015 23:13
-
-
Save HakanL/5009f01edb3b8084ea08 to your computer and use it in GitHub Desktop.
White out/Black out functionality
This file contains 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 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