Package discord4j.rest.util
Class Color
java.lang.Object
discord4j.rest.util.Color
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ColorThe color bismark ■.static final ColorThe color black ■.static final ColorThe color blue ■.static final ColorThe color brown ■.static final ColorThe color cinnabar ■.static final ColorThe color cyan ■.static final ColorThe color dark goldenrod ■.static final ColorThe color dark gray ■.static final ColorThe color deep lilac ■.static final ColorThe color deep sea ■.static final ColorThe color black ■ that can be used for Discord roles.static final ColorThe color white ■ that can be used for Discord embeds.static final ColorThe color endeavour ■.static final ColorThe color gray ■.static final ColorThe color gray chateau ■.static final ColorThe color green ■.static final ColorThe color hoki ■.static final ColorThe color jazzberry jam ■.static final ColorThe color light gray ■.static final ColorThe color light sea green ■.static final ColorThe color magenta ■.static final ColorThe color medium sea green ■.static final ColorThe color moon yellow ■.static final ColorThe color orange ■.static final ColorThe color pink ■.static final ColorThe color red ■.static final ColorThe color ruby ■.static final ColorThe color rust ■.static final ColorThe color sea green ■.static final ColorThe color submarine ■.static final ColorThe color summer sky ■.static final ColorThe color tahiti gold ■.static final ColorThe color vivid violet ■.static final ColorThe color white ■.static final ColorThe color yellow ■. -
Method Summary
Modifier and TypeMethodDescriptionbooleanintgetBlue()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.static ColorInitializes a new instance ofColorusing the specified hex color, which must be given as string.toString()
-
Field Details
-
WHITE
The color white ■. UseDISCORD_WHITEfor embeds. -
DISCORD_WHITE
The color white ■ that can be used for Discord embeds. PassingWHITEto embed is ignored by Discord. -
LIGHT_GRAY
The color light gray ■. -
GRAY
The color gray ■. -
DARK_GRAY
The color dark gray ■. -
BLACK
The color black ■. UseDISCORD_BLACKfor roles. -
DISCORD_BLACK
The color black ■ that can be used for Discord roles. PassingBLACKas role color is ignored by Discord. -
RED
The color red ■. -
PINK
The color pink ■. -
ORANGE
The color orange ■. -
YELLOW
The color yellow ■. -
GREEN
The color green ■. -
MAGENTA
The color magenta ■. -
CYAN
The color cyan ■. -
BLUE
The color blue ■. -
LIGHT_SEA_GREEN
The color light sea green ■. This is a Discord color preset. -
MEDIUM_SEA_GREEN
The color medium sea green ■. This is a Discord color preset. -
SUMMER_SKY
The color summer sky ■. This is a Discord color preset. -
DEEP_LILAC
The color deep lilac ■. This is a Discord color preset. -
RUBY
The color ruby ■. This is a Discord color preset. -
MOON_YELLOW
The color moon yellow ■. This is a Discord color preset. -
TAHITI_GOLD
The color tahiti gold ■. This is a Discord color preset. -
CINNABAR
The color cinnabar ■. This is a Discord color preset. -
SUBMARINE
The color submarine ■. This is a Discord color preset. -
HOKI
The color hoki ■. This is a Discord color preset. -
DEEP_SEA
The color deep sea ■. This is a Discord color preset. -
SEA_GREEN
The color sea green ■. This is a Discord color preset. -
ENDEAVOUR
The color endeavour ■. This is a Discord color preset. -
VIVID_VIOLET
The color vivid violet ■. This is a Discord color preset. -
JAZZBERRY_JAM
The color jazzberry jam ■. This is a Discord color preset. -
DARK_GOLDENROD
The color dark goldenrod ■. This is a Discord color preset. -
RUST
The color rust ■. This is a Discord color preset. -
BROWN
The color brown ■. This is a Discord color preset. -
GRAY_CHATEAU
The color gray chateau ■. This is a Discord color preset. -
BISMARK
The color bismark ■. This is a Discord color preset.
-
-
Method Details
-
of
Initializes a new instance ofColorusing the specified hex color, which must be given as string.- Parameters:
hexColor- the hex color in a valid format (#ffffff or ffffff)
-
of
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
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
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.
-
toString
-
equals
-
hashCode
public int hashCode()
-