1 30 31 package com.steadystate.css.dom; 32 33 import java.io.Serializable ; 34 import org.w3c.css.sac.*; 35 import org.w3c.dom.css.*; 36 37 public class RGBColorImpl implements RGBColor, Serializable { 38 39 private CSSPrimitiveValue _red = null; 40 private CSSPrimitiveValue _green = null; 41 private CSSPrimitiveValue _blue = null; 42 43 protected RGBColorImpl(LexicalUnit lu) { 44 LexicalUnit next = lu; 45 _red = new CSSValueImpl(next, true); 46 next = next.getNextLexicalUnit(); 47 next = next.getNextLexicalUnit(); 48 _green = new CSSValueImpl(next, true); 49 next = next.getNextLexicalUnit(); 50 next = next.getNextLexicalUnit(); 51 _blue = new CSSValueImpl(next, true); 52 } 53 54 protected RGBColorImpl() { 55 } 56 57 public CSSPrimitiveValue getRed() { 58 return _red; 59 } 60 61 public void setRed(CSSPrimitiveValue red) { 62 _red = red; 63 } 64 65 public CSSPrimitiveValue getGreen() { 66 return _green; 67 } 68 69 public void setGreen(CSSPrimitiveValue green) { 70 _green = green; 71 } 72 73 public CSSPrimitiveValue getBlue() { 74 return _blue; 75 } 76 77 public void setBlue(CSSPrimitiveValue blue) { 78 _blue = blue; 79 } 80 81 public String toString() { 82 return 83 "rgb(" + 84 _red.toString() + ", " + 85 _green.toString() + ", " + 86 _blue.toString() + ")"; 87 } 88 } 89 | Popular Tags |