Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Color extends FourBytes{
- public Color(int argb) {
- super(argb);
- }
- public Color(int alpha, int red, int green, int blue) {
- super(blue);
- setAlpha(alpha);
- setRed(red);
- setGreen(green);
- }
- public Color(Color other) {
- this(other.getARGB());
- }
- public int getARGB() {
- return this.getInt();
- }
- public int getAlpha() {
- return getBits(8,24);
- }
- public int getRed() {
- return getBits(8,16);
- }
- public int getGreen() {
- return getBits(8,8);
- }
- public int getBlue() {
- return getBits(8,0);
- }
- public void setARGB(int argb) {
- this.setInt(argb);
- }
- public void setAlpha(int alpha) {
- this.setBits(8, 24, alpha);
- }
- public void setRed(int red) {
- this.setBits(8, 16, red);
- }
- public void setGreen(int green) {
- this.setBits(8, 8, green);
- }
- public void setBlue(int blue) {
- this.setBits(8, 0, blue);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement