public static RGBW GetRGBW(Color inp) { var result = new RGBW(); result.W = (byte)(Math.Min(Math.Min(inp.R, inp.G), inp.B)); result.R = (byte)(inp.R - result.W); result.G = (byte)(inp.G - result.W); result.B = (byte)(inp.B - result.W); return result; }
public static RGBW GetRGBW(Color inp) { var result = new RGBW(); result.W = (byte)(Math.Min(Math.Min(inp.R, inp.G), inp.B)); result.R = (byte)(inp.R - result.W); result.G = (byte)(inp.G - result.W); result.B = (byte)(inp.B - result.W); return(result); }