public FontState(StateExpression condition, Map<String, String> params) { this.condition = condition; String colorStr = params.get("color"); if (colorStr == null) throw new IllegalArgumentException("Color must be defined."); color = Color.parserColor(colorStr); if (color == null) throw new IllegalArgumentException("Unknown color name: " + colorStr); String value = params.get("offsetX"); offsetX = value == null ? 0 : Integer.parseInt(value); value = params.get("offsetY"); offsetY = value == null ? 0 : Integer.parseInt(value); }
protected void getTintedColor(Color color, float[] result) { result[0] = tintStack.r * color.getRed(); result[1] = tintStack.g * color.getGreen(); result[2] = tintStack.b * color.getBlue(); result[3] = tintStack.a * color.getAlpha(); }