public final class ChartJsRGBAColor extends Object implements Serializable
rgba object.| Modifier and Type | Field and Description |
|---|---|
static ChartJsRGBAColor |
BLUE |
static ChartJsRGBAColor |
GREEN |
static ChartJsRGBAColor |
GREY |
static ChartJsRGBAColor |
ORANGE |
static ChartJsRGBAColor |
PURPLE |
static ChartJsRGBAColor |
RED |
static ChartJsRGBAColor |
YELLOW |
| Constructor and Description |
|---|
ChartJsRGBAColor(int red,
int green,
int blue)
Parameters should be in the range 0-255, inclusive.
|
ChartJsRGBAColor(int red,
int green,
int blue,
int alpha)
Parameters should be in the range 0-255, inclusive.
|
| Modifier and Type | Method and Description |
|---|---|
static short |
ensureValidAlphaValue(int value)
Used by the constructors to ensure the provided alpha values are valid.
|
static short |
ensureValidColourValue(int value)
Used by the constructors to ensure the provided color values are valid.
|
boolean |
equals(Object obj) |
short |
getAlpha() |
short |
getBlue() |
short |
getGreen() |
short |
getRed() |
int |
hashCode() |
String |
toJsonString() |
String |
toString() |
ChartJsRGBAColor |
withAlpha(int alpha)
Creates a new ChartJsRGBAColor object with the given value for its alpha component and the
values for the other colors from the current object.
|
ChartJsRGBAColor |
withBlue(int blue)
Creates a new ChartJsRGBAColor object with the given value for its blue component and the
values for the other colors from the current object.
|
ChartJsRGBAColor |
withGreen(int green)
Creates a new ChartJsRGBAColor object with the given value for its green component and the
values for the other colors from the current object.
|
ChartJsRGBAColor |
withRed(int red)
Creates a new ChartJsRGBAColor object with the given value for its red component and the
values for the other colors from the current object.
|
public static final ChartJsRGBAColor RED
public static final ChartJsRGBAColor ORANGE
public static final ChartJsRGBAColor YELLOW
public static final ChartJsRGBAColor GREEN
public static final ChartJsRGBAColor BLUE
public static final ChartJsRGBAColor PURPLE
public static final ChartJsRGBAColor GREY
public ChartJsRGBAColor(int red,
int green,
int blue)
public ChartJsRGBAColor(int red,
int green,
int blue,
int alpha)
public short getRed()
public short getGreen()
public short getBlue()
public short getAlpha()
public ChartJsRGBAColor withRed(int red)
red - A value between 0 and 255, inclusive.public ChartJsRGBAColor withGreen(int green)
green - A value between 0 and 255, inclusive.public ChartJsRGBAColor withBlue(int blue)
blue - A value between 0 and 255, inclusive.public ChartJsRGBAColor withAlpha(int alpha)
alpha - A value between 0 and 100, inclusive.public String toJsonString()
rgba object, for example
"rgba(25, 125, 208, 0.35)"public static short ensureValidColourValue(int value)
IllegalArgumentException - if the given value is outside the [0-255] range.public static short ensureValidAlphaValue(int value)
IllegalArgumentException - if the given value is outside the [0-100] range.Copyright © 2018. All rights reserved.