// Darkens color by specified distance public static YUVColor DarkenByDistane(this YUVColor color, float distance) { YUVColor result = (YUVColor)color.Clone(); result.Y -= distance; if (result.Y < 0) { // Y value can't be < 0 result.Y = 0.15f; } return(result); }
// Lighttens color by specified distance public static YUVColor LighttenByDistane(this YUVColor color, float distance) { YUVColor result = (YUVColor)color.Clone(); result.Y += distance; if (result.Y > 1) { // Y value can't be > 1 result.Y = 0.85f; } return(result); }