/** Sets the color for the following drawing operations. * * @param r The red component. * @param g The green component. * @param b The blue component. * @param a The alpha component. */ public void setColor (float r, float g, float b, float a) { color = Color.rgba8888(r, g, b, a); }
/** Sets the color for the following drawing operations. * @param color The color. */ public void setColor (Color color) { this.color = Color.rgba8888(color.r, color.g, color.b, color.a); }
/** Sets the color for the following drawing operations. * @param color The color. */ public void setColor (Color color) { this.color = Color.rgba8888(color.r, color.g, color.b, color.a); }
/** Sets the color for the following drawing operations. * * @param r The red component. * @param g The green component. * @param b The blue component. * @param a The alpha component. */ public void setColor (float r, float g, float b, float a) { color = Color.rgba8888(r, g, b, a); }
void drawToPixmap (Gdx2DPixmap pixmap) { pixmap.clear(Color.rgba8888(1, 0, 0, 0.1f)); pixmap.setPixel(16, 16, Color.rgba8888(0, 0, 1, 1)); int clearColor = 0; int pixelColor = 0; switch (pixmap.getFormat()) { case Gdx2DPixmap.GDX2D_FORMAT_ALPHA: clearColor = Color.rgba8888(1, 1, 1, 0.1f); pixelColor = Color.rgba8888(1, 1, 1, 1); break; case Gdx2DPixmap.GDX2D_FORMAT_LUMINANCE_ALPHA: break; case Gdx2DPixmap.GDX2D_FORMAT_RGB565: clearColor = Color.rgba8888(1, 0, 0, 1); pixelColor = Color.rgba8888(0, 0, 1, 1); break; case Gdx2DPixmap.GDX2D_FORMAT_RGB888: clearColor = Color.rgba8888(1, 0, 0, 1); pixelColor = Color.rgba8888(0, 0, 1, 1); break; case Gdx2DPixmap.GDX2D_FORMAT_RGBA4444: clearColor = 0xff000011; pixelColor = Color.rgba8888(0, 0, 1, 1); break; case Gdx2DPixmap.GDX2D_FORMAT_RGBA8888: clearColor = Color.rgba8888(1, 0, 0, 0.1f); pixelColor = Color.rgba8888(0, 0, 1, 1); pixmap.drawLine(0, 0, 31, 31, Color.rgba8888(1, 1, 1, 1));
float depth = MathUtils.clamp(buffer.get(x + y * bufferWidth), 0, Float.POSITIVE_INFINITY); float c = depth * extent; debugPixmap.drawPixel(x, y, Color.rgba8888(c, c, c, 1));
} else { pixmap = new Pixmap(width, rows, Format.RGBA8888); int rgba = Color.rgba8888(color); byte[] srcRow = new byte[rowBytes]; int[] dstRow = new int[width];
} else { pixmap = new Pixmap(width, rows, Format.RGBA8888); int rgba = Color.rgba8888(color); byte[] srcRow = new byte[rowBytes]; int[] dstRow = new int[width];
/** Sets the color for the following drawing operations. * @param color The color. */ public void setColor (Color color) { this.color = Color.rgba8888(color.r, color.g, color.b, color.a); }
/** Sets the color for the following drawing operations. * * @param r The red component. * @param g The green component. * @param b The blue component. * @param a The alpha component. */ public void setColor (float r, float g, float b, float a) { color = Color.rgba8888(r, g, b, a); }
public static int convert(Color color) { return Color.rgba8888(color); }
/** * Returns an SColor representation of the provided Color. If there is a * named SColor constant that matches the value, then that constant is * returned. * * @param color * @return */ public SColor asSColor(Color color) { return colorForValue(Color.rgba8888(color.a, color.r, color.g, color.b)); }
int dist; for (int i = 0; i < plen; i++) { color = Color.rgba8888(colorPalette[i]); paletteArray[i] = color; paletteMapping[(color >>> 17 & 0x7C00) | (color >>> 14 & 0x3E0) | (color >>> 11 & 0x1F)] = (byte) i;
int dist; for (int i = 0; i < plen; i++) { color = Color.rgba8888(colorPalette[i]); paletteArray[i] = color; paletteMapping[(color >>> 17 & 0x7C00) | (color >>> 14 & 0x3E0) | (color >>> 11 & 0x1F)] = (byte) i;
public static BaseLightDescriptor convert(BaseLight light) { if (light == null) return null; BaseLightDescriptor lightDescriptor = new BaseLightDescriptor(); lightDescriptor.setIntensity(light.intensity); lightDescriptor.setColor(Color.rgba8888(light.color)); return lightDescriptor; }
public static FogDescriptor convert(Fog fog) { if (fog == null) return null; FogDescriptor fogDescriptor = new FogDescriptor(); fogDescriptor.setDensity(fog.density); fogDescriptor.setGradient(fog.gradient); fogDescriptor.setColor(Color.rgba8888(fog.color)); return fogDescriptor; }
} else { pixmap = new Pixmap(width, rows, Format.RGBA8888); int rgba = Color.rgba8888(color); byte[] srcRow = new byte[rowBytes]; int[] dstRow = new int[width];
public int additiveBlend(int pixelColor, SplatTexture.Channel channel, float strength) { c0.set(pixelColor); if (channel == SplatTexture.Channel.BASE) { c0.sub(strength, strength, strength, strength); } else if (channel == SplatTexture.Channel.R) { c0.add(strength, 0, 0, 0); } else if (channel == SplatTexture.Channel.G) { c0.add(0, strength, 0, 0); } else if (channel == SplatTexture.Channel.B) { c0.add(0, 0, strength, 0); } else if (channel == SplatTexture.Channel.A) { c0.add(0, 0, 0, strength); } // prevent the sum to be greater than 1 final float sum = c0.r + c0.g + c0.b + c0.a; if (sum > 1f) { final float correction = 1f / sum; c0.r *= correction; c0.g *= correction; c0.b *= correction; c0.a *= correction; } return Color.rgba8888(c0); }
public void clearChannel(SplatTexture.Channel channel) { Pixmap pixmap = getPixmap(); for (int smX = 0; smX < pixmap.getWidth(); smX++) { for (int smY = 0; smY < pixmap.getHeight(); smY++) { c0.set(pixmap.getPixel(smX, smY)); if (channel == SplatTexture.Channel.R) { c0.set(0, c0.g, c0.b, c0.a); } else if (channel == SplatTexture.Channel.G) { c0.set(c0.r, 0, c0.b, c0.a); } else if (channel == SplatTexture.Channel.B) { c0.set(c0.r, c0.g, 0, c0.a); } else if (channel == SplatTexture.Channel.A) { c0.set(c0.r, c0.g, c0.b, 0); } pixmap.drawPixel(smX, smY, Color.rgba8888(c0)); } } }