public final class SpreadsheetColor extends Object implements com.gembox.internal.core.Equatable<SpreadsheetColor>
Spreadsheet color can either be empty / none, automatic, theme, standard or custom.
Empty, automatic, theme and standard colors can be created using the factory method fromName(ColorName)
which accepts ColorName
parameter.
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Determines whether the specified
Object is equal to this SpreadsheetColor instance. |
static SpreadsheetColor |
fromArgb(int argb)
Creates a
SpreadsheetColor class from a 32-bit ARGB value. |
static SpreadsheetColor |
fromArgb(int red,
int green,
int blue)
Creates a
SpreadsheetColor class from the specified 8-bit color values (red, green, and blue). |
static SpreadsheetColor |
fromColor(Color color)
Performs a conversion from
Color to SpreadsheetColor . |
static SpreadsheetColor |
fromName(ColorName name)
Creates a
SpreadsheetColor class from the specified predefined color. |
short |
getB()
Gets the blue component value of this
SpreadsheetColor class. |
short |
getG()
Gets the green component value of this
SpreadsheetColor class. |
short |
getR()
Gets the red component value of this
SpreadsheetColor class. |
int |
hashCode()
Returns a hash code for this
SpreadsheetColor instance. |
boolean |
isEmpty()
Specifies whether this
SpreadsheetColor class is uninitialized. |
int |
toArgb()
Gets the 32-bit ARGB value of this
SpreadsheetColor class. |
Color |
toColor()
Performs a conversion from
SpreadsheetColor to Color . |
String |
toString()
Returns a
String that represents this SpreadsheetColor instance. |
public boolean equals(Object obj)
Object
is equal to this SpreadsheetColor
instance.equals
in class Object
obj
- The Object
to compare with this SpreadsheetColor
instance.true
if the specified Object
is a SpreadsheetColor
and is equal to this SpreadsheetColor
instance; otherwise, false
.public static SpreadsheetColor fromArgb(int argb)
SpreadsheetColor
class from a 32-bit ARGB value.argb
- A value specifying the 32-bit ARGB value.SpreadsheetColor
class with the specified value.public static SpreadsheetColor fromArgb(int red, int green, int blue)
SpreadsheetColor
class from the specified 8-bit color values (red, green, and blue). The alpha value is implicitly 255 (fully opaque). Although this method allows a 32-bit value to be passed for each color component, the value of each component is limited to 8 bits.red
- The red component value for the new SpreadsheetColor
. Valid values are 0 through 255.green
- The green component value for the new SpreadsheetColor
. Valid values are 0 through 255.blue
- The blue component value for the new SpreadsheetColor
. Valid values are 0 through 255.SpreadsheetColor
class with the specified values.IndexOutOfBoundsException
- Parameter red
, green
, or blue
is less than 0 or greater than 255.public static SpreadsheetColor fromColor(Color color)
Color
to SpreadsheetColor
.color
- The input Color
color.SpreadsheetColor
which is the result of the conversion.public static SpreadsheetColor fromName(ColorName name)
SpreadsheetColor
class from the specified predefined color.name
- An element of the ColorName
enumeration.SpreadsheetColor
class with the specified value.public short getB()
SpreadsheetColor
class.SpreadsheetColor
class.public short getG()
SpreadsheetColor
class.SpreadsheetColor
class.public short getR()
SpreadsheetColor
class.SpreadsheetColor
class.public int hashCode()
SpreadsheetColor
instance.hashCode
in class Object
SpreadsheetColor
instance.public boolean isEmpty()
SpreadsheetColor
class is uninitialized.true
if this SpreadsheetColor
class is uninitialized; otherwise, false
.public int toArgb()
SpreadsheetColor
class.SpreadsheetColor
.public Color toColor()
SpreadsheetColor
to Color
.Color
which is the result of the conversion.public String toString()
String
that represents this SpreadsheetColor
instance.
This method should be used primarily for debugging purposes and should be considered volatile (format of its return value might change in future versions).
toString
in class Object
String
that represents this SpreadsheetColor
instance.© GemBox Ltd. — All rights reserved.