Fills the specified tile with the given color at 50% alpha.
Intended for debug-only tile highlighting purposes.
487777
protected void fillTile (
        Graphics2D gfx, int tx, int ty, Color color)
    {
        Composite ocomp = gfx.getComposite();
        gfx.setComposite(ALPHA_FILL_TILE);
        Polygon poly = MisoUtil.getTilePolygon(_metrics, tx, ty);
        gfx.setColor(color);
        gfx.fill(poly);
        gfx.setComposite(ocomp);
    }
810825
def fill(self, color):
        
        self.matrix = [[color for _ in range(self.height)] for _ in range(self.width)]
1265461
public static FillInfo createFill(String color, float opacity) {
		FillInfo fillInfo = new FillInfo();
		if (color != null) {
			fillInfo.getCssParameterList().add(createCssParameter("fill", color));
		}
		fillInfo.getCssParameterList().add(createCssParameter("fill-opacity", opacity));
		return fillInfo;
	}
602227
public final void setColors(Color[] colors) {
        int[] pixels = ((DataBufferInt)img.getRaster().getDataBuffer()).getData();
        for (int y = 0; y < height; ++y) {
            for (int x = 0; x < width; ++x) {
                int idx = x + y * width;
                if (colors.length <= idx) break;
                int red   = (int)(colors[idx].getRed()   * 255.0);
                int green = (int)(colors[idx].getGreen() * 255.0);
                int blue  = (int)(colors[idx].getBlue()  * 255.0);
                int alpha = (int)(colors[idx].getAlpha() * 255.0);
                pixels[idx] = alpha << 24 |
                              red   << 16 |
                              green << 8  |
                              blue;
            }
        }
    }
71152
function(color, ctx){
            ctx = ctx || this.bufferCtx;
            ctx.fillStyle = color || this.bgColor;
            ctx.fillRect(
                0,
                0,
                this.canvas.width,
                this.canvas.height
            );
        }
868858
public void fill(Graphic g, ColorRgba color)
    {
        g.setColor(color);
        g.drawRect(0, 0, source.getWidth(), source.getHeight(), true);
    }
995017
static Object wrapColor4(float red, float green, float blue, float alpha) {
        ByteBuffer temp = ByteBuffer.allocate(4 * 4);
        temp.putFloat(red);
        temp.putFloat(green);
        temp.putFloat(blue);
        temp.putFloat(alpha);
        temp.flip();
        return s_wrapperProvider.wrapColor(temp, 0);
    }
767303
@ColorInt public static int increaseOpacity(Context context, @ColorRes int res, int alpha) {
        int c = resolveColor(res, context);
        return increaseOpacityFromInt(context, resolveColor(res, context), alpha);
    }
519695
def to_truecolor_alpha_bytes(color)
      [r(color), g(color), b(color), a(color)]
    end
288883
public void setLayerOpacity(int alpha, int layer) {

        if ((alpha >= 0) && (alpha <= 100) && isAttached()) {
            Element colorbar;

            switch (layer) {
                case COLORBAR_A:
                    colorbar = m_colorA.getElement();
                    break;
                case COLORBAR_B:
                    colorbar = m_colorB.getElement();
                    break;
                case COLORBAR_C:
                    colorbar = m_colorC.getElement();
                    break;
                case COLORBAR_D:
                    colorbar = m_colorD.getElement();
                    break;
                default:
                    return;
            }
            colorbar.getStyle().setOpacity((1.0 * alpha) / 100);
            CmsTransparencyImpl.setTransparency(colorbar, alpha);
        }
    }
1325826
public void setComposite(Composite comp) {
        
		if (comp instanceof AlphaComposite) {

			AlphaComposite composite = (AlphaComposite) comp;

			if (composite.getRule() == 3) {

				alpha = composite.getAlpha();
				this.composite = composite;

				if (realPaint != null && (realPaint instanceof Color)) {

					Color c = (Color) realPaint;
					paint = new Color(c.getRed(), c.getGreen(), c.getBlue(),
							(int) (c.getAlpha() * alpha));
				}
				return;
			}
		}

		this.composite = comp;
		alpha = 1.0F;

    }
1025299
public void drawRectangle(int x, int y, int z, int width, int height, int color, int alpha)
	{
		drawRectangle(x, y, z, width, height, color, alpha, true);
	}
232655
def _fill(self):
        """"""
        r, g, b = hue2col(self._hue)
        width = self.winfo_width()
        height = self.winfo_height()
        h = float(height - 1)
        w = float(width - 1)
        if height:
            c = [(r + i / h * (255 - r), g + i / h * (255 - g), b + i / h * (255 - b)) for i in range(height)]
            data = []
            for i in range(height):
                line = []
                for j in range(width):
                    rij = round2(j / w * c[i][0])
                    gij = round2(j / w * c[i][1])
                    bij = round2(j / w * c[i][2])
                    color = rgb_to_hexa(rij, gij, bij)
                    line.append(color)
                data.append("{" + " ".join(line) + "}")
            self.bg.put(" ".join(data))
174839
public void setColorFill(Color color) {
    	PdfXConformanceImp.checkPDFXConformance(writer, PdfXConformanceImp.PDFXKEY_COLOR, color);
        int type = ExtendedColor.getType(color);
        switch (type) {
            case ExtendedColor.TYPE_GRAY: {
                setGrayFill(((GrayColor)color).getGray());
                break;
            }
            case ExtendedColor.TYPE_CMYK: {
                CMYKColor cmyk = (CMYKColor)color;
                setCMYKColorFillF(cmyk.getCyan(), cmyk.getMagenta(), cmyk.getYellow(), cmyk.getBlack());
                break;
            }
            case ExtendedColor.TYPE_SEPARATION: {
                SpotColor spot = (SpotColor)color;
                setColorFill(spot.getPdfSpotColor(), spot.getTint());
                break;
            }
            case ExtendedColor.TYPE_PATTERN: {
                PatternColor pat = (PatternColor) color;
                setPatternFill(pat.getPainter());
                break;
            }
            case ExtendedColor.TYPE_SHADING: {
                ShadingColor shading = (ShadingColor) color;
                setShadingFill(shading.getPdfShadingPattern());
                break;
            }
            default:
                setRGBColorFill(color.getRed(), color.getGreen(), color.getBlue());
        }
    }
805609
@ColorInt
    public static int getAlphaColor(@ColorInt int color, @IntRange(from = 0, to = 255) int alpha) {
        int red = Color.red(color);
        int green = Color.green(color);
        int blue = Color.blue(color);
        return Color.argb(alpha, red, green, blue);
    }
334042
private static void applyAlpha(BufferedImage pImage, BufferedImage pAlpha) {
        // Apply alpha as transparency, using threshold of 25%
        for (int y = 0; y < pAlpha.getHeight(); y++) {
            for (int x = 0; x < pAlpha.getWidth(); x++) {

                // Get alpha component of pixel, if less than 25% opaque
                // (0x40 = 64 => 25% of 256), the pixel will be transparent
                if (((pAlpha.getRGB(x, y) >> 24) & 0xFF) < 0x40) {
                    pImage.setRGB(x, y, 0x00FFFFFF); // 100% transparent
                }
            }
        }
    }
1308931
def fillLayerWithColor(self, color):
		
		layer = self.image.getActiveLayer().data
		colorRGBA = color.get_0_255()
		layer[:,:,0] = colorRGBA[0]
		layer[:,:,1] = colorRGBA[1]
		layer[:,:,2] = colorRGBA[2]
		layer[:,:,3] = colorRGBA[3]