public WindowStyle (WindowStyle style) { this.background = style.background; this.titleFont = style.titleFont; this.titleFontColor = new Color(style.titleFontColor); } }
/** @return a copy of this color */ public Color cpy () { return new Color(this); } }
public LabelStyle (LabelStyle style) { this.font = style.font; if (style.fontColor != null) fontColor = new Color(style.fontColor); background = style.background; } }
public TextButtonStyle (TextButtonStyle style) { super(style); this.font = style.font; if (style.fontColor != null) this.fontColor = new Color(style.fontColor); if (style.downFontColor != null) this.downFontColor = new Color(style.downFontColor); if (style.overFontColor != null) this.overFontColor = new Color(style.overFontColor); if (style.checkedFontColor != null) this.checkedFontColor = new Color(style.checkedFontColor); if (style.checkedOverFontColor != null) this.checkedOverFontColor = new Color(style.checkedOverFontColor); if (style.disabledFontColor != null) this.disabledFontColor = new Color(style.disabledFontColor); } }
@Override protected Color newObject () { return new Color(); } };
public TextButtonStyle (TextButtonStyle style) { super(style); this.font = style.font; if (style.fontColor != null) this.fontColor = new Color(style.fontColor); if (style.downFontColor != null) this.downFontColor = new Color(style.downFontColor); if (style.overFontColor != null) this.overFontColor = new Color(style.overFontColor); if (style.checkedFontColor != null) this.checkedFontColor = new Color(style.checkedFontColor); if (style.checkedOverFontColor != null) this.checkedOverFontColor = new Color(style.checkedOverFontColor); if (style.disabledFontColor != null) this.disabledFontColor = new Color(style.disabledFontColor); } }
/** @return a copy of this color */ public Color cpy () { return new Color(this); } }
public LabelStyle (LabelStyle style) { this.font = style.font; if (style.fontColor != null) fontColor = new Color(style.fontColor); background = style.background; } }
public WindowStyle (WindowStyle style) { this.background = style.background; this.titleFont = style.titleFont; this.titleFontColor = new Color(style.titleFontColor); } }
/** Returns a new color from a hex string with the format RRGGBBAA. * @see #toString() */ public static Color valueOf (String hex) { hex = hex.charAt(0) == '#' ? hex.substring(1) : hex; int r = Integer.valueOf(hex.substring(0, 2), 16); int g = Integer.valueOf(hex.substring(2, 4), 16); int b = Integer.valueOf(hex.substring(4, 6), 16); int a = hex.length() != 8 ? 255 : Integer.valueOf(hex.substring(6, 8), 16); return new Color(r / 255f, g / 255f, b / 255f, a / 255f); }
/** Returns a new color from a hex string with the format RRGGBBAA. * @see #toString() */ public static Color valueOf (String hex) { hex = hex.charAt(0) == '#' ? hex.substring(1) : hex; int r = Integer.valueOf(hex.substring(0, 2), 16); int g = Integer.valueOf(hex.substring(2, 4), 16); int b = Integer.valueOf(hex.substring(4, 6), 16); int a = hex.length() != 8 ? 255 : Integer.valueOf(hex.substring(6, 8), 16); return new Color(r / 255f, g / 255f, b / 255f, a / 255f); }
public ModelMaterial getMaterial (final String name) { for (final ModelMaterial m : materials) if (m.id.equals(name)) return m; ModelMaterial mat = new ModelMaterial(); mat.id = name; mat.diffuse = new Color(Color.WHITE); materials.add(mat); return mat; } }
public ModelMaterial getMaterial (final String name) { for (final ModelMaterial m : materials) if (m.id.equals(name)) return m; ModelMaterial mat = new ModelMaterial(); mat.id = name; mat.diffuse = new Color(Color.WHITE); materials.add(mat); return mat; } }
public void mouseClicked (MouseEvent evt) { java.awt.Color color = JColorChooser.showDialog(null, "Choose a background color", EffectUtil.fromString(prefs.get("background", "000000"))); if (color == null) return; renderingBackgroundColor = new Color(color.getRed() / 255f, color.getGreen() / 255f, color.getBlue() / 255f, 1); backgroundColorLabel.setIcon(getColorIcon(color)); prefs.put("background", EffectUtil.toString(color)); } });
public void mouseClicked (MouseEvent evt) { java.awt.Color color = JColorChooser.showDialog(null, "Choose a background color", EffectUtil.fromString(prefs.get("background", "000000"))); if (color == null) return; renderingBackgroundColor = new Color(color.getRed() / 255f, color.getGreen() / 255f, color.getBlue() / 255f, 1); backgroundColorLabel.setIcon(getColorIcon(color)); prefs.put("background", EffectUtil.toString(color)); } });
public SelectBoxStyle (SelectBoxStyle style) { this.font = style.font; this.fontColor.set(style.fontColor); if (style.disabledFontColor != null) this.disabledFontColor = new Color(style.disabledFontColor); this.background = style.background; this.backgroundOver = style.backgroundOver; this.backgroundOpen = style.backgroundOpen; this.backgroundDisabled = style.backgroundDisabled; this.scrollStyle = new ScrollPaneStyle(style.scrollStyle); this.listStyle = new ListStyle(style.listStyle); } }
public SelectBoxStyle (SelectBoxStyle style) { this.font = style.font; this.fontColor.set(style.fontColor); if (style.disabledFontColor != null) this.disabledFontColor = new Color(style.disabledFontColor); this.background = style.background; this.backgroundOver = style.backgroundOver; this.backgroundOpen = style.backgroundOpen; this.backgroundDisabled = style.backgroundDisabled; this.scrollStyle = new ScrollPaneStyle(style.scrollStyle); this.listStyle = new ListStyle(style.listStyle); } }
private Color parseColor (JsonValue colorArray) { if (colorArray.size >= 3) return new Color(colorArray.getFloat(0), colorArray.getFloat(1), colorArray.getFloat(2), 1.0f); else throw new GdxRuntimeException("Expected Color values <> than three."); }
public Color read (Json json, JsonValue jsonData, Class type) { if (jsonData.isString()) return get(jsonData.asString(), Color.class); String hex = json.readValue("hex", String.class, (String)null, jsonData); if (hex != null) return Color.valueOf(hex); float r = json.readValue("r", float.class, 0f, jsonData); float g = json.readValue("g", float.class, 0f, jsonData); float b = json.readValue("b", float.class, 0f, jsonData); float a = json.readValue("a", float.class, 1f, jsonData); return new Color(r, g, b, a); } });
public Color read (Json json, JsonValue jsonData, Class type) { if (jsonData.isString()) return get(jsonData.asString(), Color.class); String hex = json.readValue("hex", String.class, (String)null, jsonData); if (hex != null) return Color.valueOf(hex); float r = json.readValue("r", float.class, 0f, jsonData); float g = json.readValue("g", float.class, 0f, jsonData); float b = json.readValue("b", float.class, 0f, jsonData); float a = json.readValue("a", float.class, 1f, jsonData); return new Color(r, g, b, a); } });