Skip to content

Commit

Permalink
Tweak Colors
Browse files Browse the repository at this point in the history
  • Loading branch information
FirstMegaGame4 committed Jul 30, 2023
1 parent 1b06286 commit a5306b8
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions src/main/java/com/mmodding/mmodding_lib/library/utils/Colors.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ public class Colors {

public static abstract class ColorFormat {

private ColorComponent a = this.createAComponent();
private ColorComponent b = this.createBComponent();
private ColorComponent c = this.createCComponent();
private final ColorComponent a = this.createAComponent();
private final ColorComponent b = this.createBComponent();
private final ColorComponent c = this.createCComponent();

private ColorFormat(int a, int b, int c) {
this.a.setValue(a);
Expand Down Expand Up @@ -144,18 +144,18 @@ public ARGB toARGB(int alpha) {
return new ARGB(alpha, this);
}

public Color toJavaColor() {
return new Color(this.getRed(), this.getGreen(), this.getBlue());
}

public int toDecimal() {
return ColorUtil.ARGB32.getArgb(255, this.getRed(), this.getGreen(), this.getBlue());
}

public Color toJavaColor() {
return new Color(this.getRed(), this.getGreen(), this.getBlue());
}
}

public static class ARGB extends RGB {

private ColorComponent alpha = new ColorComponent(0, 255);
private final ColorComponent alpha = new ColorComponent(0, 255);

public ARGB(int alpha, RGB rgb) {
this(alpha, rgb.getRed(), rgb.getGreen(), rgb.getBlue());
Expand Down Expand Up @@ -189,12 +189,14 @@ public int alterAlpha(int alteration) {
return this.setAlpha(this.getAlpha() + alteration);
}

public Color toJavaColor() {
return new Color(this.getAlpha(), this.getRed(), this.getGreen(), this.getBlue());
}

@Override
public int toDecimal() {
return ColorUtil.ARGB32.getArgb(this.getAlpha(), this.getRed(), this.getGreen(), this.getBlue());
}

@Override
public Color toJavaColor() {
return new Color(this.getAlpha(), this.getRed(), this.getGreen(), this.getBlue());
}
}
}

0 comments on commit a5306b8

Please sign in to comment.