Package discord4j.rest.util
Class Color
- java.lang.Object
-
- discord4j.rest.util.Color
-
public final class Color extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static ColorBISMARKThe color bismark ■.static ColorBLACKThe color black ■.static ColorBLUEThe color blue ■.static ColorBROWNThe color brown ■.static ColorCINNABARThe color cinnabar ■.static ColorCYANThe color cyan ■.static ColorDARK_GOLDENRODThe color dark goldenrod ■.static ColorDARK_GRAYThe color dark gray ■.static ColorDEEP_LILACThe color deep lilac ■.static ColorDEEP_SEAThe color deep sea ■.static ColorDISCORD_BLACKThe color black ■ that can be used for Discord roles.static ColorDISCORD_WHITEThe color white ■ that can be used for Discord embeds.static ColorENDEAVOURThe color endeavour ■.static ColorGRAYThe color gray ■.static ColorGRAY_CHATEAUThe color gray chateau ■.static ColorGREENThe color green ■.static ColorHOKIThe color hoki ■.static ColorJAZZBERRY_JAMThe color jazzberry jam ■.static ColorLIGHT_GRAYThe color light gray ■.static ColorLIGHT_SEA_GREENThe color light sea green ■.static ColorMAGENTAThe color magenta ■.static ColorMEDIUM_SEA_GREENThe color medium sea green ■.static ColorMOON_YELLOWThe color moon yellow ■.static ColorORANGEThe color orange ■.static ColorPINKThe color pink ■.static ColorREDThe color red ■.static ColorRUBYThe color ruby ■.static ColorRUSTThe color rust ■.static ColorSEA_GREENThe color sea green ■.static ColorSUBMARINEThe color submarine ■.static ColorSUMMER_SKYThe color summer sky ■.static ColorTAHITI_GOLDThe color tahiti gold ■.static ColorVIVID_VIOLETThe color vivid violet ■.static ColorWHITEThe color white ■.static ColorYELLOWThe color yellow ■.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)intgetBlue()Returns the blue value for this color, as an integer in the range 0-255.intgetGreen()Returns the green value for this color, as an integer in the range 0-255.intgetRed()Returns the red value for this color, as an integer in the range 0-255.intgetRGB()Returns the RGB value for this color.inthashCode()static Colorof(float red, float green, float blue)Initializes a new instance ofColorusing the specified red, green, and blue values, which must be given as floats in the range of 0.0F-1.0F.static Colorof(int rgb)Initializes a new instance ofColorusing the specified RGB value.static Colorof(int red, int green, int blue)Initializes a new instance ofColorusing the specified red, green, and blue values, which must be given as integers in the range of 0-255.StringtoString()
-
-
-
Field Detail
-
WHITE
public static final Color WHITE
The color white ■. UseDISCORD_WHITEfor embeds.
-
DISCORD_WHITE
public static final Color DISCORD_WHITE
The color white ■ that can be used for Discord embeds. PassingWHITEto embed is ignored by Discord.
-
LIGHT_GRAY
public static final Color LIGHT_GRAY
The color light gray ■.
-
GRAY
public static final Color GRAY
The color gray ■.
-
DARK_GRAY
public static final Color DARK_GRAY
The color dark gray ■.
-
BLACK
public static final Color BLACK
The color black ■. UseDISCORD_BLACKfor roles.
-
DISCORD_BLACK
public static final Color DISCORD_BLACK
The color black ■ that can be used for Discord roles. PassingBLACKas role color is ignored by Discord.
-
RED
public static final Color RED
The color red ■.
-
PINK
public static final Color PINK
The color pink ■.
-
ORANGE
public static final Color ORANGE
The color orange ■.
-
YELLOW
public static final Color YELLOW
The color yellow ■.
-
GREEN
public static final Color GREEN
The color green ■.
-
MAGENTA
public static final Color MAGENTA
The color magenta ■.
-
CYAN
public static final Color CYAN
The color cyan ■.
-
BLUE
public static final Color BLUE
The color blue ■.
-
LIGHT_SEA_GREEN
public static final Color LIGHT_SEA_GREEN
The color light sea green ■. This is a Discord color preset.
-
MEDIUM_SEA_GREEN
public static final Color MEDIUM_SEA_GREEN
The color medium sea green ■. This is a Discord color preset.
-
SUMMER_SKY
public static final Color SUMMER_SKY
The color summer sky ■. This is a Discord color preset.
-
DEEP_LILAC
public static final Color DEEP_LILAC
The color deep lilac ■. This is a Discord color preset.
-
RUBY
public static final Color RUBY
The color ruby ■. This is a Discord color preset.
-
MOON_YELLOW
public static final Color MOON_YELLOW
The color moon yellow ■. This is a Discord color preset.
-
TAHITI_GOLD
public static final Color TAHITI_GOLD
The color tahiti gold ■. This is a Discord color preset.
-
CINNABAR
public static final Color CINNABAR
The color cinnabar ■. This is a Discord color preset.
-
SUBMARINE
public static final Color SUBMARINE
The color submarine ■. This is a Discord color preset.
-
HOKI
public static final Color HOKI
The color hoki ■. This is a Discord color preset.
-
DEEP_SEA
public static final Color DEEP_SEA
The color deep sea ■. This is a Discord color preset.
-
SEA_GREEN
public static final Color SEA_GREEN
The color sea green ■. This is a Discord color preset.
-
ENDEAVOUR
public static final Color ENDEAVOUR
The color endeavour ■. This is a Discord color preset.
-
VIVID_VIOLET
public static final Color VIVID_VIOLET
The color vivid violet ■. This is a Discord color preset.
-
JAZZBERRY_JAM
public static final Color JAZZBERRY_JAM
The color jazzberry jam ■. This is a Discord color preset.
-
DARK_GOLDENROD
public static final Color DARK_GOLDENROD
The color dark goldenrod ■. This is a Discord color preset.
-
RUST
public static final Color RUST
The color rust ■. This is a Discord color preset.
-
BROWN
public static final Color BROWN
The color brown ■. This is a Discord color preset.
-
GRAY_CHATEAU
public static final Color GRAY_CHATEAU
The color gray chateau ■. This is a Discord color preset.
-
BISMARK
public static final Color BISMARK
The color bismark ■. This is a Discord color preset.
-
-
Method Detail
-
of
public static Color of(float red, float green, float blue)
Initializes a new instance ofColorusing the specified red, green, and blue values, which must be given as floats in the range of 0.0F-1.0F.- Parameters:
red- The red component of the RGB value.green- The green component of the RGB value.blue- The blue component of the RGB value.
-
of
public static Color of(int red, int green, int blue)
Initializes a new instance ofColorusing the specified red, green, and blue values, which must be given as integers in the range of 0-255.- Parameters:
red- The red component of the RGB value.green- The green component of the RGB value.blue- The blue component of the RGB value.
-
of
public static Color of(int rgb)
Initializes a new instance ofColorusing the specified RGB value. The blue value is in bits 0-7, green in bits 8-15, and red in bits 16-23.- Parameters:
rgb- The RGB value.
-
getRGB
public int getRGB()
Returns the RGB value for this color. The blue value will be in bits 0-7, green in 8-15, and red in 16-23.- Returns:
- The RGB value for this color.
-
getRed
public int getRed()
Returns the red value for this color, as an integer in the range 0-255.- Returns:
- The red value for this color.
-
getGreen
public int getGreen()
Returns the green value for this color, as an integer in the range 0-255.- Returns:
- The green value for this color.
-
getBlue
public int getBlue()
Returns the blue value for this color, as an integer in the range 0-255.- Returns:
- The blue value for this color.
-
-