static public RGBA operator*(RGBA rgba, double scale) { rgba.Red = RGBA.ToByte(rgba.Red * scale); rgba.Green = RGBA.ToByte(rgba.Green * scale); rgba.Blue = RGBA.ToByte(rgba.Blue * scale); rgba.Alpha = RGBA.ToByte(rgba.Alpha * scale); return(rgba); }
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------ // offset rgba value by a constant static public RGBA operator+(RGBA rgba, int offset) { rgba.Red = RGBA.ToByte(rgba.Red + offset); rgba.Green = RGBA.ToByte(rgba.Green + offset); rgba.Blue = RGBA.ToByte(rgba.Blue + offset); rgba.Alpha = RGBA.ToByte(rgba.Alpha + offset); return(rgba); }
static public RGBA operator+(RGBA rgba, double d) { int offset = (int)(d * 255); rgba.Red = RGBA.ToByte(rgba.Red + offset); rgba.Green = RGBA.ToByte(rgba.Green + offset); rgba.Blue = RGBA.ToByte(rgba.Blue + offset); rgba.Alpha = RGBA.ToByte(rgba.Alpha + offset); return(rgba); }