@Override public String toString() { return name + " " + super.toString(); }
@Override public String getText() { return selected==null?null:selected.toString(); }
/** * Creates a new color that's the same value as the passed in color. * Simply sets the name of this SColor to {@link Color#toString()}. * * @param color an existing libGDX Color to copy */ public SColor(Color color) { super(color); this.calculatedFloat = NumberTools.intBitsToFloat(((int)(255 * a) << 24 & 0xfe000000) | ((int)(255 * b) << 16) | ((int)(255 * g) << 8) | ((int)(255 * r))); name = super.toString(); }
@Override public void finished (Color newColor) { setText(newColor.toString()); } });
/** * Creates a new color that has the given RGB values from 0 to 255 (inclusive). * Alpha will be fully opaque. * * @param r red from 0 to 255, both inclusive * @param g green from 0 to 255, both inclusive * @param b blue from 0 to 255, both inclusive */ public SColor(int r, int g, int b) { super(r * 0.003921569f, g * 0.003921569f, b * 0.003921569f, 1.0f); this.calculatedFloat = NumberTools.intBitsToFloat(((int)(255 * a) << 24 & 0xfe000000) | ((int)(255 * b) << 16) | ((int)(255 * g) << 8) | ((int)(255 * r))); name = super.toString(); }
/** * Creates a new color that has the given RGBA values. * * @param r red from 0 to 255, both inclusive * @param g green from 0 to 255, both inclusive * @param b blue from 0 to 255, both inclusive * @param a alpha from 0 to 255, both inclusive */ public SColor(int r, int g, int b, int a) { super(r * 0.003921569f, g * 0.003921569f, b * 0.003921569f, a * 0.003921569f); this.calculatedFloat = NumberTools.intBitsToFloat(((int)(255 * a) << 24 & 0xfe000000) | ((int)(255 * b) << 16) | ((int)(255 * g) << 8) | ((int)(255 * r))); name = super.toString(); }
/** * Creates a new color that has the given combined RGB value. * Alpha will be fully opaque. * * @param colorValue an RGB int value; does not include alpha (it will be opaque) */ public SColor(int colorValue) { super((colorValue << 8) | 255); this.calculatedFloat = NumberTools.intBitsToFloat(((int)(255 * a) << 24 & 0xfe000000) | ((int)(255 * b) << 16) | ((int)(255 * g) << 8) | ((int)(255 * r))); name = super.toString(); }
private void serializeProjectSection(ProjectModel projectModel, StringBuilder sb) { sb.append("\n\n").append(SECTION_DIVIDER).append("\n\n"); sb.append("version=").append(AppConstants.version.toString()).append("\n"); FileTypeModel fileType = projectModel.getFileType(); sb.append("fileTypeType=").append(fileType.getType().key).append("\n"); sb.append("fileTypeData=").append(fileType.serializeState()).append("\n"); sb.append("previewBackgroundColor=").append(projectModel.getPreviewBackgroundColor().toString()).append("\n"); }
@SuppressWarnings("static-access") public Texture getCircleColorTexture(int radius, Color color) { Texture circle = textures.get("circle" + radius + color.toString()); if (circle == null) { Pixmap pixmap = new Pixmap(radius * 2 + 2, radius * 2 + 2, Format.RGBA8888); pixmap.setColor(color); pixmap.fillCircle(radius + 1, radius + 1, radius); circle = new Texture(pixmap); circle.setFilter(filter, filter); textures.put("circle" + radius + color.toString(), circle); circle.setAssetManager(assets); pixmap.dispose(); } return circle; }
/** * 获取颜色像素点 */ @SuppressWarnings("static-access") public Texture getColorPointTexture(Color color) { Texture colorPoint = textures.get("color" + color.toString()); if (colorPoint == null) { Pixmap pixmap = new Pixmap(1, 1, Format.RGBA8888); pixmap.setColor(color); pixmap.fill(); colorPoint = new Texture(pixmap); colorPoint.setFilter(filter, filter); textures.put("color" + color.toString(), colorPoint); colorPoint.setAssetManager(assets); pixmap.dispose(); } return colorPoint; }
json.writeValue(field.getName(), aa.toString()); } else if (o instanceof Color) { json.writeValue(field.getName(), ((Color) o).toString()); } else if (o instanceof Vector2) { json.writeValue(field.getName(), Param.toStringParam((Vector2) o));
protected void updateUI () { palette.setPickerHue(verticalBar.getValue()); newColorImg.setColor(color); hexField.setText(color.toString().toUpperCase()); hexField.setCursorPosition(hexField.getMaxLength()); if (listener != null) listener.changed(color); }
borderWidth.setText(Integer.toString(tr.getBorderWidth())); textAlign.setText(AlignUtils.getAlign(tr.getAlign())); borderColor.setText(tr.getBorderColor().toString()); borderStraight.setText(Boolean.toString(tr.isBorderStraight())); shadowOffsetX.setText(Integer.toString(tr.getShadowOffsetX())); shadowOffsetY.setText(Integer.toString(tr.getShadowOffsetY())); shadowColor.setText(tr.getShadowColor().toString()); scale.setText(Param.toStringParam(new Vector2(sa.getScaleX(), sa.getScaleY()))); rot.setText(Float.toString(sa.getRot())); tint.setText(sa.getTint() == null ? null : sa.getTint().toString()); bboxFromRenderer.setText(Boolean.toString(sa.isBboxFromRenderer())); orgAlign.setText(AlignUtils.getAlign(sa.getRenderer().getOrgAlign())); textColor.setText(ca.getTextColor() == null ? null : ca.getTextColor().toString()); textStyle.setText(ca.getTextStyle()); talkingTextPos.setText(Param.toStringParam(ca.getTalkingTextPos()));