1 18 package org.apache.batik.css.engine.value; 19 20 import org.w3c.dom.DOMException ; 21 import org.w3c.dom.css.CSSPrimitiveValue; 22 23 29 public class RGBColorValue extends AbstractValue { 30 31 34 protected Value red; 35 36 39 protected Value green; 40 41 44 protected Value blue; 45 46 49 public RGBColorValue(Value r, Value g, Value b) { 50 red = r; 51 green = g; 52 blue = b; 53 } 54 55 58 public short getPrimitiveType() { 59 return CSSPrimitiveValue.CSS_RGBCOLOR; 60 } 61 62 65 public String getCssText() { 66 return "rgb(" + 67 red.getCssText() + ", " + 68 green.getCssText() + ", " + 69 blue.getCssText() + ")"; 70 } 71 72 75 public Value getRed() throws DOMException { 76 return red; 77 } 78 79 82 public Value getGreen() throws DOMException { 83 return green; 84 } 85 86 89 public Value getBlue() throws DOMException { 90 return blue; 91 } 92 93 96 public String toString() { 97 return getCssText(); 98 } 99 } 100 | Popular Tags |