From 385d9f9fed2e79070a8eb6f3612576b1be2b740d Mon Sep 17 00:00:00 2001 From: Filip Weiss Date: Mon, 15 Jun 2020 11:27:32 +0200 Subject: RGB add simpler constructor without alpha --- .../io/github/cottonmc/cotton/gui/widget/data/Color.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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() { -- cgit