示例#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;
 }
 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));
 }
 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());
 }