Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
        //------------------------------------------------------------------------------------
        //------------------------------------------------------------------------------------

        // 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);
        }
Exemplo n.º 3
0
        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);
        }