diff options
author | Falkreon <falkreon@gmail.com> | 2019-09-22 10:46:44 -0500 |
---|---|---|
committer | Falkreon <falkreon@gmail.com> | 2019-09-22 10:46:49 -0500 |
commit | 486ca631fc2747adaad3268dfa1ec9ac16c5cd86 (patch) | |
tree | 43a5f6fcbeba81f0a9e9e0b7929513f5ad6349d5 /src/main/java/io | |
parent | 4a0360b555821cf4d2d3342540608f3361f6a0e7 (diff) | |
download | LibGui-486ca631fc2747adaad3268dfa1ec9ac16c5cd86.tar.gz LibGui-486ca631fc2747adaad3268dfa1ec9ac16c5cd86.tar.bz2 LibGui-486ca631fc2747adaad3268dfa1ec9ac16c5cd86.zip |
Palette work
Diffstat (limited to 'src/main/java/io')
-rw-r--r-- | src/main/java/io/github/cottonmc/cotton/gui/style/StyleEntry.java | 8 | ||||
-rw-r--r-- | src/main/java/io/github/cottonmc/cotton/gui/widget/data/Color.java | 30 |
2 files changed, 38 insertions, 0 deletions
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/style/StyleEntry.java b/src/main/java/io/github/cottonmc/cotton/gui/style/StyleEntry.java index 0af23ad..e7318a7 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/style/StyleEntry.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/style/StyleEntry.java @@ -2,8 +2,16 @@ package io.github.cottonmc.cotton.gui.style; import java.util.HashMap; +import io.github.cottonmc.cotton.gui.widget.data.Color; + public class StyleEntry { + private String selector = "*"; private HashMap<String, String> customEntries = new HashMap<>(); + private Color foreground; + private Color background; + public Color getForeground() { + return (foreground!=null) ? foreground : Color.WHITE; + } } 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 bf6806a..ec40500 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 @@ -1,6 +1,36 @@ package io.github.cottonmc.cotton.gui.widget.data; public interface Color { + public static final Color WHITE = rgb(0xFF_FFFFFF); + public static final Color BLACK = rgb(0xFF_000000); + public static final Color RED = rgb(0xFF_FF0000); + public static final Color GREEN = rgb(0xFF_00FF00); + public static final Color BLUE = rgb(0xFF_0000FF); + + public static final Color WHITE_DYE = rgb(0xFF_F9FFFE); + public static final Color ORANGE_DYE = rgb(0xFF_F9801D); + public static final Color MAGENTA_DYE = rgb(0xFF_C74EBD); + public static final Color LIGHT_BLUE_DYE = rgb(0xFF_3AB3DA); + public static final Color YELLOW_DYE = rgb(0xFF_FED83D); + public static final Color LIME_DYE = rgb(0xFF_80C71F); + public static final Color PINK_DYE = rgb(0xFF_F38BAA); + public static final Color GRAY_DYE = rgb(0xFF_474F52); + public static final Color LIGHT_GRAY_DYE = rgb(0xFF_9D9D97); + public static final Color CYAN_DYE = rgb(0xFF_169C9C); + public static final Color PURPLE_DYE = rgb(0xFF_8932B8); + public static final Color BLUE_DYE = rgb(0xFF_3C44AA); + public static final Color BROWN_DYE = rgb(0xFF_835432); + public static final Color GREEN_DYE = rgb(0xFF_5E7C16); + public static final Color RED_DYE = rgb(0xFF_B02E26); + public static final Color BLACK_DYE = rgb(0xFF_1D1D21); + + Color[] DYE_COLORS = { + WHITE_DYE, ORANGE_DYE, MAGENTA_DYE, LIGHT_BLUE_DYE, + YELLOW_DYE, LIME_DYE, PINK_DYE, GRAY_DYE, + LIGHT_GRAY_DYE, CYAN_DYE, PURPLE_DYE, BLUE_DYE, + BROWN_DYE, GREEN_DYE, RED_DYE, BLACK_DYE + }; + /** * Gets an ARGB integer representing this color in the sRGB colorspace. */ |