Set the foreground color.

        Parameters
        ----------
        r, g, b : float
            RGB values, which should be between 0 and 1, inclusive.
772899
def set_fg(self, r, g, b):
        
        self.img_fg = (r, g, b)
        self.redraw(whence=3)
289185
protected void paintBackground (Graphics g)
    {
        // simply fill our background color
        g.setColor(getBackground());
        g.fillRect(0, 0, getWidth(), getHeight());
    }
1032232
function Color4(r, g, b, a) {
            if (r === void 0) { r = 0; }
            if (g === void 0) { g = 0; }
            if (b === void 0) { b = 0; }
            if (a === void 0) { a = 1; }
            this.r = r;
            this.g = g;
            this.b = b;
            this.a = a;
        }
743082
def _init_rgb(self, r: int, g: int, b: int) -> None:
        
        if self.rgb_mode:
            self.rgb = (r, g, b)
            self.hexval = rgb2hex(r, g, b)
        else:
            self.rgb = hex2rgb(rgb2termhex(r, g, b))
            self.hexval = rgb2termhex(r, g, b)

        self.code = hex2term(self.hexval)
245458
def set_foregroundcolor(self, color):
         '''
         '''

         ax = self.ax

         for tl in ax.get_xticklines() + ax.get_yticklines():
             tl.set_color(color)
         for spine in ax.spines:
             ax.spines[spine].set_edgecolor(color)
         for tick in ax.xaxis.get_major_ticks():
             tick.label1.set_color(color)
         for tick in ax.yaxis.get_major_ticks():
             tick.label1.set_color(color)
         ax.axes.xaxis.label.set_color(color)
         ax.axes.yaxis.label.set_color(color)
         ax.axes.xaxis.get_offset_text().set_color(color)
         ax.axes.yaxis.get_offset_text().set_color(color)
         ax.axes.title.set_color(color)
         lh = ax.get_legend()
         if lh != None:
             lh.get_title().set_color(color)
             lh.legendPatch.set_edgecolor('none')
             labels = lh.get_texts()
             for lab in labels:
                 lab.set_color(color)
         for tl in ax.get_xticklabels():
             tl.set_color(color)
         for tl in ax.get_yticklabels():
             tl.set_color(color)
         plt.draw()
897796
def set_text_color(self, r,g=-1,b=-1):
        ""
        if((r==0 and g==0 and b==0) or g==-1):
            self.text_color=sprintf('%.3f g',r/255.0)
        else:
            self.text_color=sprintf('%.3f %.3f %.3f rg',r/255.0,g/255.0,b/255.0)
        self.color_flag=(self.fill_color!=self.text_color)
366185
public void setBackground(float x, float y, float z, float a) {
		gl.glClearColor(x / 255, y / 255, z / 255, a / 255);
	}
461778
private int applyFog( int rgb , float fraction ) {
		// avoid floating point math
		int adjustment = (int)(1000*fraction);

		int r = (rgb >> 16)&0xFF;
		int g = (rgb >> 8)&0xFF;
		int b = rgb & 0xFF;

		r = (r * adjustment + ((backgroundColor>>16)&0xFF)*(1000-adjustment)) / 1000;
		g = (g * adjustment + ((backgroundColor>>8)&0xFF)*(1000-adjustment)) / 1000;
		b = (b * adjustment + (backgroundColor&0xFF)*(1000-adjustment)) / 1000;

		return (r << 16) | (g << 8) | b;
	}
948368
public function foreColor($r, $g, $b) {
        $this->renderer->setForegroundColor(new Rgb($r, $g, $b));

        return $this;
    }
1056972
def setGridColor(self, color):
        
        palette = self.palette()
        palette.setColor(palette.GridForeground, QColor(color))
1012243
def set_background(self, background):
        
        scene = self.scene
        scene.setBackgroundBrush(QColor.fromRgba(background.argb))
1082392
public function setTextColor($r, $g, $b)
    {
        $this->textColor = array($r, $g, $b);

        return $this;
    }
852146
public void setRGB(int red, int green, int blue) throws Exception {

        if ((red < 0) || (red > 255)) {
            throw new Exception();
        }
        if ((green < 0) || (green > 255)) {
            throw new Exception();
        }
        if ((blue < 0) || (blue > 255)) {
            throw new Exception();
        }

        m_red = (float)red / 255;
        m_green = (float)green / 255;
        m_blue = (float)blue / 255;

        RGBtoHSV(m_red, m_green, m_blue);

        setHex();
    }
409447
def _rgba(r, g, b, a, **kwargs):
    
    return ColorValue((float(r), float(g), float(b), float(a)))
276317
public function setLineColor($r, $g, $b)
    {

        $this->ink['line'] = imagecolorallocate($this->im, $r, $g, $b);
    }
1060451
public function setBackgroundColor($r, $g, $b)
    {
        $this->backgroundColor = array($r, $g, $b);

        return $this;
    }
930350
public void setBackgroundColor(int color) {
        setBackgroundColorR(Colors.byteToGl(Color.red(color)));
        setBackgroundColorG(Colors.byteToGl(Color.green(color)));
        setBackgroundColorB(Colors.byteToGl(Color.blue(color)));
        setBackgroundColorA(Colors.byteToGl(Color.alpha(color)));
    }