예제 #1
0
 public static TGColor newColor(int r, int g, int b) {
   TGColor color = new TGFactory().newColor();
   color.setR(r);
   color.setG(g);
   color.setB(b);
   return color;
 }
예제 #2
0
 private void readColor(TGColor color) throws IOException {
   color.setR(readUnsignedByte());
   color.setG(readUnsignedByte());
   color.setB(readUnsignedByte());
   read();
 }
예제 #3
0
 private void writeRGBColor(TGColor color) {
   // escribo el RGB
   writeByte(color.getR());
   writeByte(color.getG());
   writeByte(color.getB());
 }
예제 #4
0
 private void readRGBColor(TGColor color) {
   // leo el RGB
   color.setR((readByte() & 0xff));
   color.setG((readByte() & 0xff));
   color.setB((readByte() & 0xff));
 }
예제 #5
0
 private void readColor(TGColor color) {
   // escribo el RGB
   color.setR(readInt());
   color.setG(readInt());
   color.setB(readInt());
 }
예제 #6
0
 public void copyFrom(TGColor color) {
   this.setR(color.getR());
   this.setG(color.getG());
   this.setB(color.getB());
 }
예제 #7
0
 public TGColor clone(TGFactory factory) {
   TGColor tgColor = factory.newColor();
   tgColor.copyFrom(this);
   return tgColor;
 }
예제 #8
0
 public boolean isEqual(TGColor color) {
   return (this.getR() == color.getR()
       && this.getG() == color.getG()
       && this.getB() == color.getB());
 }