aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuuxel <6596629+Juuxel@users.noreply.github.com>2020-07-11 14:06:53 +0300
committerGitHub <noreply@github.com>2020-07-11 14:06:53 +0300
commit65ff902aaf7025f90efb739ab0cca985f2f59c59 (patch)
tree03c07a896a14a7534387711324238cb12109565a
parentd4fb1f7c357822c4331c60e112decdf25b282bd5 (diff)
parent385d9f9fed2e79070a8eb6f3612576b1be2b740d (diff)
downloadLibGui-65ff902aaf7025f90efb739ab0cca985f2f59c59.tar.gz
LibGui-65ff902aaf7025f90efb739ab0cca985f2f59c59.tar.bz2
LibGui-65ff902aaf7025f90efb739ab0cca985f2f59c59.zip
RGB add simpler constructor without alpha (#65)
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/widget/data/Color.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/data/Color.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/data/Color.java
index 92c27ce..9b78ae9 100644
--- a/src/main/java/io/github/cottonmc/cotton/gui/widget/data/Color.java
+++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/data/Color.java
@@ -63,6 +63,19 @@ public interface Color {
((g & 0xFF) << 8) |
(b & 0xFF);
}
+
+ /**
+ * Constructs an RGB object with 100% alpha value (no transparency)
+ *
+ * @since 2.0.0
+ */
+ public RGB(int r, int g, int b) {
+ value =
+ (0xFF << 24) |
+ ((r & 0xFF) << 16) |
+ ((g & 0xFF) << 8) |
+ (b & 0xFF);
+ }
@Override
public int toRgb() {