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;
 }
 private void readColor(TGColor color) throws IOException {
   color.setR(readUnsignedByte());
   color.setG(readUnsignedByte());
   color.setB(readUnsignedByte());
   read();
 }
 private void writeRGBColor(TGColor color) {
   // escribo el RGB
   writeByte(color.getR());
   writeByte(color.getG());
   writeByte(color.getB());
 }
Beispiel #4
0
 private void readRGBColor(TGColor color) {
   // leo el RGB
   color.setR((readByte() & 0xff));
   color.setG((readByte() & 0xff));
   color.setB((readByte() & 0xff));
 }
 private void readColor(TGColor color) {
   // escribo el RGB
   color.setR(readInt());
   color.setG(readInt());
   color.setB(readInt());
 }
 public void copyFrom(TGColor color) {
   this.setR(color.getR());
   this.setG(color.getG());
   this.setB(color.getB());
 }
 public TGColor clone(TGFactory factory) {
   TGColor tgColor = factory.newColor();
   tgColor.copyFrom(this);
   return tgColor;
 }
 public boolean isEqual(TGColor color) {
   return (this.getR() == color.getR()
       && this.getG() == color.getG()
       && this.getB() == color.getB());
 }