Colors all pixels the given ***color***.
174253
def fill(self, color):
        """"""
        auto_write = self.auto_write
        self.auto_write = False
        for i, _ in enumerate(self):
            self[i] = color
        if auto_write:
            self.show()
        self.auto_write = auto_write
699128
private static Color[] rainbow(int n, float start, float end, float alpha) {
        return rainbow(n, start, end, 1.0f, 1.0f, alpha);
    }
669445
public Set<RGBColor> colours() {
        return stream().map(Pixel::toColor).collect(Collectors.toSet());
    }
142011
def toColor(val, colormap):
    """"""
    for i in range(0, len(colormap) - 1):
        if colormap[i + 1][0] > val:
            scale = (val - colormap[i][0]) / \
                (colormap[i + 1][0] - colormap[i][0])
            r = colormap[i][1][0] + \
                (colormap[i + 1][1][0] - colormap[i][1][0]) * scale
            g = colormap[i][1][1] + \
                (colormap[i + 1][1][1] - colormap[i][1][1]) * scale
            b = colormap[i][1][2] + \
                (colormap[i + 1][1][2] - colormap[i][1][2]) * scale
            return "#" + toHex(r) + toHex(g) + toHex(b)
    return "#" + toHex(colormap[-1][1][0]) + toHex(colormap[-1][1][1]) + toHex(colormap[-1][1][2])
1033731
def set_rgb(self, red, green, blue):
        
        x, y = rgb_to_xy(red, green, blue)
        self.xy = [x, y]
764682
def color(self, color):
        
        if color is None:
            color = 0xFFFFFFFF

        idc.SetColor(self.ea, idc.CIC_ITEM, color)
1053559
def set_pixel(x,y,color)

      index = (y*@width + x)
      pointindex = index*3
      @array[pointindex+2] = color.r.chr
      @array[pointindex+1] = color.g.chr
      @array[pointindex] = color.b.chr

      if color.a != 255 then
        @alpha = 255.chr*(@height * @width) unless @alpha
        @alpha[index] = color.a.chr
      end

      self
    end
318278
function rgb(red, green, blue){
  switch (arguments.length) {
    case 1:
      utils.assertColor(red);
      var color = red.rgba;
      return new nodes.RGBA(
          color.r
        , color.g
        , color.b
        , 1);
    default:
      return rgba(
          red
        , green
        , blue
        , new nodes.Unit(1));
  }
}
481684
def any_to_rgb(color):
    '''

    '''
    if isinstance(color, tuple):
        if len(color) == 3:
            color = color + (255,)
        return color
        
    if isinstance(color, str):
        return parse_color(color)
        
    raise ValueError("Color not recognized: {}".format(color))
1010998
public void setColor(float red, float green, float blue) {
		setRed(red);
		setGreen(green);
		setBlue(blue);
	}
1332751
function (data, colorFunc, state) {
        var gradientPixels = this._gradientPixels;
        var pixelsSingleState = gradientPixels[state] || (gradientPixels[state] = new Uint8ClampedArray(256 * 4));
        var color = [0, 0, 0, 0];
        var off = 0;
        for (var i = 0; i < 256; i++) {
            colorFunc[state](i / 255, true, color);
            pixelsSingleState[off++] = color[0];
            pixelsSingleState[off++] = color[1];
            pixelsSingleState[off++] = color[2];
            pixelsSingleState[off++] = color[3];
        }
        return pixelsSingleState;
    }
677397
public void setEdgeColor(Color color) {
        if (edgeColor == null) edgeColor = new RGBColor(0.0, 0.0, 0.0);
        setGradation(true);
        this.edgeColor = color;
    }
1326409
def color_(self, i=None):
        
        global palette, color_num
        if i is not None:
            color_num = i
        if color_num == len(palette) - 1:
            color_num = 0
        res = palette[color_num]
        color_num += 1
        return res
464417
def scale_pixels(color, layer):
    """"""
    pixelmap = []

    # Scaling the pixel offsets.
    for pix_x in range(MAX_X + 1):
        for pix_y in range(MAX_Y + 1):

            # Horizontal pixels
            y1 = pix_y * dotsize[0]
            x1 = pix_x * dotsize[1]

            # Vertical pixels
            y2 = pix_y * dotsize[0] + (dotsize[0] - 1)
            x2 = pix_x * dotsize[1] + (dotsize[1] - 1)

            if (y1 <= MAX_Y) and (y2 <= MAX_Y):
                if (x1 <= MAX_X) and (x2 <= MAX_X):
                    if (pix_x, pix_y) in layer:
                        pixelmap.append([(y1, x1), (y2, x2), color])
    return pixelmap
603434
public void setCustomLedColor(final Color COLOR) {
        model.setCustomLedColor(new CustomLedColor(COLOR));
        final boolean LED_WAS_ON = currentLedImage.equals(ledImageOn) ? true : false;

        switch (getOrientation()) {
            case HORIZONTAL:
                recreateLedImages(getHeight());
                break;
            case VERTICAL:
                recreateLedImages(getWidth());
                break;
            default:
                recreateLedImages();
                break;
        }

        if (currentLedImage != null) {
            currentLedImage.flush();
        }
        currentLedImage = LED_WAS_ON == true ? ledImageOn : ledImageOff;

        repaint(getInnerBounds());
    }
480595
public void setColorRange(int firstIndex, int lastIndex, int color1, int color2) {
		for (int i = firstIndex; i <= lastIndex; i++)
			map[i] = ImageMath.mixColors((float)(i-firstIndex)/(lastIndex-firstIndex), color1, color2);
	}
177232
def gdk(self, color):
        """"""
        c = self.parse(color)
        return gdk.Color.from_floats(c)