diff options
author | Filip Weiss <me@fiws.net> | 2020-06-15 11:27:32 +0200 |
---|---|---|
committer | Filip Weiss <me@fiws.net> | 2020-06-15 11:27:32 +0200 |
commit | 385d9f9fed2e79070a8eb6f3612576b1be2b740d (patch) | |
tree | bb690fcccdc364b828ed5dd9d9e11f130e848a47 /src/main/java/io | |
parent | 5d25b13198a78276b1aab7e902a3e587c44c7ce6 (diff) | |
download | LibGui-385d9f9fed2e79070a8eb6f3612576b1be2b740d.tar.gz LibGui-385d9f9fed2e79070a8eb6f3612576b1be2b740d.tar.bz2 LibGui-385d9f9fed2e79070a8eb6f3612576b1be2b740d.zip |
RGB add simpler constructor without alpha
Diffstat (limited to 'src/main/java/io')
-rw-r--r-- | src/main/java/io/github/cottonmc/cotton/gui/widget/data/Color.java | 13 |
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 3dbbe39..9ed9d38 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() { |