Copyright 2012 Mobialia
http://www.mobialia.com/
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to ...
If you think the Android project jmini3d listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
package jmini3d;
/*fromwww.java2s.com*/publicclass Color4 {
publicfloat r;
publicfloat g;
publicfloat b;
publicfloat a;
publicstatic Color4 fromFloat(float r, float g, float b, float a) {
Color4 color4 = new Color4();
color4.r = r;
color4.g = g;
color4.b = b;
color4.a = a;
return color4;
}
public Color4() {
}
public Color4(int r, int g, int b) {
this.r = r / 255f;
this.g = g / 255f;
this.b = b / 255f;
this.a = 1;
}
public Color4(int r, int g, int b, int a) {
this.r = r / 255f;
this.g = g / 255f;
this.b = b / 255f;
this.a = a / 255f;
}
publicvoid setAll(long argb32) {
a = ((argb32 >> 24) & 0x000000FF) / 255f;
r = ((argb32 >> 16) & 0x000000FF) / 255f;
g = ((argb32 >> 8) & 0x000000FF) / 255f;
b = ((argb32) & 0x000000FF) / 255f;
}
publicvoid setAll(int r, int g, int b, int a) {
this.r = r / 255f;
this.g = g / 255f;
this.b = b / 255f;
this.a = a / 255f;
}
publicvoid setAllFrom(Color4 color) {
this.r = color.r;
this.g = color.g;
this.b = color.b;
this.a = color.a;
}
publicboolean equals(Object o) {
if (o == null) {
return false;
}
if (!(o instanceof Color4)) {
return false;
}
return (r == ((Color4) o).r) && (g == ((Color4) o).g) && (b == ((Color4) o).b) && (a == ((Color4) o).a);
}
}