/** * Create a {@code SetBackgroundColor} tag from RGB component values. */ public SetBackgroundColorTag(short red, short green, short blue) { this(new RGB(red, green, blue)); }
@Override public String description() { return backgroundColor.toString(); } }
/** * Create a {@code SetBackgroundColor} tag from RGB component values. */ public SetBackgroundColorTag(short red, short green, short blue) { this(new RGB(red, green, blue)); }
@Override public String toString() { return color.toString() + ratio; } }
/** * @param color to print. * @return string formatted as #RRGGBB */ public String printColor(RGB color) { StringBuilder b = new StringBuilder(); b.append('#'); int red = color.getRed(); b.append(digits[(red >> 4) & 15]); b.append(digits[red & 15]); int green = color.getGreen(); b.append(digits[(green >> 4) & 15]); b.append(digits[green & 15]); int blue = color.getBlue(); b.append(digits[(blue >> 4) & 15]); b.append(digits[blue & 15]); if (color instanceof RGBA) { int alpha = ((RGBA)color).getAlpha(); b.append(digits[(alpha >> 4) & 15]); b.append(digits[alpha & 15]); } return b.toString(); }
protected final RGB getBackgroundColor() throws InterruptedException { if (swfBackgroundColor != null) return swfBackgroundColor; int swfBackgroundColorInt = targetSettings.getDefaultBackgroundColor(); String attrBackgroundColorString = getTargetAttributes().getBackgroundColor(); if (!Strings.isNullOrEmpty(attrBackgroundColorString)) { if (project instanceof RoyaleProject) swfBackgroundColorInt = ((RoyaleProject)project).getColorAsInt(attrBackgroundColorString); else swfBackgroundColorInt = Integer.decode(attrBackgroundColorString).intValue(); } swfBackgroundColor = new RGB(swfBackgroundColorInt); return swfBackgroundColor; }
@Override public String description() { return backgroundColor.toString(); } }
/** * @param color to print. * @return string formatted as #RRGGBB */ public String printColor(RGB color) { StringBuilder b = new StringBuilder(); b.append('#'); int red = color.getRed(); b.append(digits[(red >> 4) & 15]); b.append(digits[red & 15]); int green = color.getGreen(); b.append(digits[(green >> 4) & 15]); b.append(digits[green & 15]); int blue = color.getBlue(); b.append(digits[(blue >> 4) & 15]); b.append(digits[blue & 15]); if (color instanceof RGBA) { int alpha = ((RGBA)color).getAlpha(); b.append(digits[(alpha >> 4) & 15]); b.append(digits[alpha & 15]); } return b.toString(); }
protected final RGB getBackgroundColor() throws InterruptedException { if (swfBackgroundColor != null) return swfBackgroundColor; int swfBackgroundColorInt = targetSettings.getDefaultBackgroundColor(); String attrBackgroundColorString = getTargetAttributes().getBackgroundColor(); if (!Strings.isNullOrEmpty(attrBackgroundColorString)) { if (project instanceof RoyaleProject) swfBackgroundColorInt = ((RoyaleProject)project).getColorAsInt(attrBackgroundColorString); else swfBackgroundColorInt = Integer.decode(attrBackgroundColorString).intValue(); } swfBackgroundColor = new RGB(swfBackgroundColorInt); return swfBackgroundColor; }
@Override public String toString() { return color.toString() + ratio; } }
private RGB readRGB() { return new RGB( bitStream.readUI8(), bitStream.readUI8(), bitStream.readUI8()); }
private RGB readRGB() { return new RGB( bitStream.readUI8(), bitStream.readUI8(), bitStream.readUI8()); }
/** * return a data structure for FB integration * @return */ public ISWF getSWFTarget() { SWF swf = new SWF(); Rect rect = new Rect(getTargetSettings().getDefaultWidth(), getTargetSettings().getDefaultHeight()); swf.setFrameSize(rect); // we might need to report actual color some day swf.setBackgroundColor(new RGB(255, 255, 255)); swf.setTopLevelClass(config.getTargetFile()); return swf; }