Class Color
java.lang.Object
org.spongepowered.api.util.Color
- All Implemented Interfaces:
RGBLike, DataSerializable
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Colorstatic final Colorstatic final Colorstatic final Colorstatic final Colorstatic final Colorstatic final Colorstatic final Colorstatic final Colorstatic final Colorstatic final Colorstatic final Colorstatic final Colorstatic final Colorstatic final Colorstatic final Color -
Method Summary
Modifier and TypeMethodDescription@IntRange(from=0L,to=255L) intblue()Gets the currentbluevalue of thisColor.intGets the content version of thisDataSerializable.boolean@IntRange(from=0L,to=255L) intgreen()Gets theredvalue of thisColor.inthashCode()static Colorstatic ColormixDyeColors(DyeColor... colors) mixWithColors(Color... colors) Creates a new color with the providedColors.mixWithDyes(DyeColor... dyeColors) static Colorstatic Colorstatic Colorstatic Colorstatic ColorofRgb(int hex) static ColorofRgb(int red, int green, int blue) @IntRange(from=0L,to=255L) intred()Gets theredvalue of thisColor.intrgb()Gets thered green bluerepresentation of this color in a "hexadecimal" format.Serializes this object into a comprehensibleDataContainer.toString()withBlue(int blue) withGreen(int green) withRed(int red) Methods inherited from interface DataSerializable
toView
-
Field Details
-
BLACK
-
GRAY
-
WHITE
-
BLUE
-
GREEN
-
LIME
-
RED
-
YELLOW
-
MAGENTA
-
PURPLE
-
DARK_CYAN
-
DARK_GREEN
-
DARK_MAGENTA
-
CYAN
-
NAVY
-
PINK
-
-
Method Details
-
ofRgb
-
ofRgb
Gets a newColorbased on the hexadecimal value for a combinedred,green, andbluecolor. Note that colors do not utilize an alpha modifier- Parameters:
red- The red valuegreen- The green valueblue- The blue value- Returns:
- The color object
-
of
-
of
-
of
-
of
-
mixDyeColors
-
mixColors
-
red
-
withRed
-
green
-
withGreen
-
blue
-
withBlue
-
asJavaColor
-
rgb
public int rgb()Gets thered green bluerepresentation of this color in a "hexadecimal" format.- Returns:
- The current color value in a hexadecimal format
-
mixWithColors
-
mixWithDyes
- Parameters:
dyeColors- The dye colors to mix- Returns:
- The new color
-
contentVersion
public int contentVersion()Description copied from interface:DataSerializableGets the content version of thisDataSerializable. The version may differ between instances of plugins and implementations such that theDataViewfromDataSerializable.toContainer()may include different information, or remove other information as they are no longer deemed necessary. The version goes hand in hand withDataContentUpdateras it is required when there exists anyDataViewof thisDataSerializablewith an "older" version.- Specified by:
contentVersionin interfaceDataSerializable- Returns:
- The version of the content being serialized
-
toContainer
Description copied from interface:DataSerializableSerializes this object into a comprehensibleDataContainer.- Specified by:
toContainerin interfaceDataSerializable- Returns:
- A newly created DataContainer
-
hashCode
-
equals
-
toString
-