public class ArgbColor extends com.aspose.ms.lang.Struct<ArgbColor> implements ICssDataType
Represents one color value in ARGB format with converters and serializers
| Modifier and Type | Class and Description |
|---|---|
static class |
ArgbColor.Keywords |
| Constructor and Description |
|---|
ArgbColor() |
ArgbColor(int r,
int g,
int b) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(ArgbColor other)
Checks two
ArgbColor colors for equality |
boolean |
equals(ICssDataType other)
Checks two
ArgbColor colors for equality |
boolean |
equals(Object other)
Tests if another object is equal to this
ArgbColor instance. |
static ArgbColor |
fromColor(Color color)
Creates one
ArgbColor value from specified Color |
static ArgbColor |
fromRgb(int red,
int green,
int blue)
Creates one
ArgbColor value from specified Red, Green, Blue channels, while Alpha channel is fully opaque |
static ArgbColor |
fromRgba(int red,
int green,
int blue,
int alpha)
Creates one
ArgbColor value from specified Red, Green, Blue, and Alpha channels |
static ArgbColor |
fromSingleValueRgb(byte value)
Creates a fully opaque (A=255) color from single value, which will be applied to all channels
|
int |
getA()
Gets the alpha part of the color.
|
double |
getAlpha()
Gets the alpha part of the color in percent (0..1).
|
int |
getB()
Gets the blue part of the color.
|
int |
getG()
Gets the green part of the color.
|
int |
getR()
Gets the red part of the color.
|
int |
getValue()
Gets the Int32 value of the color.
|
int |
hashCode()
Returns a hash code that defines the current color.
|
boolean |
isDefault()
Indicates whether this
ArgbColor instance is default (Transparent) - all 4 channels are set to 0 |
boolean |
isEmpty()
Uninitialized color - all 4 channels are set to 0.
|
boolean |
isFullyOpaque()
Indicates whether this
ArgbColor instance is fully opaque, without transparency (its Alpha channel has max value) |
boolean |
isFullyTransparent()
Indicates whether this
ArgbColor instance is fully transparent - its Alpha channel has the min (0) value, so other R, G, and B channels has no visible effect. |
boolean |
isTranslucent()
Indicates whether this
ArgbColor instance is translucent (not fully transparent, but also not fully opaque) |
static boolean |
op_Equality(ArgbColor left,
ArgbColor right)
Compares two colors and returns a boolean indicating if the two do match.
|
static boolean |
op_Inequality(ArgbColor left,
ArgbColor right)
Compares two colors and returns a boolean indicating if the two do not match.
|
String |
serializeDefault()
Serializes this
ArgbColor instance to the most appropriate CSS function notation depending on translucency |
String |
toRGB()
Serializes this
ArgbColor instance to the 'rgb' CSS function notation |
String |
toRGBA()
Serializes this
ArgbColor instance to the 'rgba' CSS function notation |
String |
toString()
Same as
serializeDefault() |
Color |
toSystemColor()
Converts a value of this
ArgbColor instance to the Color instance and returns it |
public final boolean equals(ArgbColor other)
Checks two ArgbColor colors for equality
other - The other ArgbColor colorpublic final boolean equals(ICssDataType other)
Checks two ArgbColor colors for equality
other - The other ArgbColor color, casted to the ICssDataTypepublic boolean equals(Object other)
Tests if another object is equal to this ArgbColor instance.
equals in interface com.aspose.ms.System.IEquatable<ICssDataType>equals in class Objectother - The object to test with.public static ArgbColor fromColor(Color color)
Creates one ArgbColor value from specified Color
color - public static ArgbColor fromRgb(int red, int green, int blue)
Creates one ArgbColor value from specified Red, Green, Blue channels, while Alpha channel is fully opaque
red - Red channel valuegreen - Green channel valueblue - Blue channel valueArgbColor valuepublic static ArgbColor fromRgba(int red, int green, int blue, int alpha)
Creates one ArgbColor value from specified Red, Green, Blue, and Alpha channels
red - Red channel valuegreen - Green channel valueblue - Blue channel valuealpha - Alpha channel valueArgbColor valuepublic static ArgbColor fromSingleValueRgb(byte value)
Creates a fully opaque (A=255) color from single value, which will be applied to all channels
value - A byte value, same for Red, Green, and Blue channelsArgbColor instancepublic final int getA()
Gets the alpha part of the color.
public final double getAlpha()
Gets the alpha part of the color in percent (0..1).
public final int getB()
Gets the blue part of the color.
public final int getG()
Gets the green part of the color.
public final int getR()
Gets the red part of the color.
public final int getValue()
Gets the Int32 value of the color.
public int hashCode()
Returns a hash code that defines the current color.
public final boolean isDefault()
Indicates whether this ArgbColor instance is default (Transparent) - all 4 channels are set to 0
isDefault in interface ICssDataTypepublic final boolean isEmpty()
Uninitialized color - all 4 channels are set to 0. Same as Default and Transparent.
public final boolean isFullyOpaque()
Indicates whether this ArgbColor instance is fully opaque, without transparency (its Alpha channel has max value)
public final boolean isFullyTransparent()
Indicates whether this ArgbColor instance is fully transparent - its Alpha channel has the min (0) value, so other R, G, and B channels has no visible effect.
public final boolean isTranslucent()
Indicates whether this ArgbColor instance is translucent (not fully transparent, but also not fully opaque)
public static boolean op_Equality(ArgbColor left, ArgbColor right)
Compares two colors and returns a boolean indicating if the two do match.
left - The first color to use.right - The second color to use.public static boolean op_Inequality(ArgbColor left, ArgbColor right)
Compares two colors and returns a boolean indicating if the two do not match.
left - The first color to use.right - The second color to use.public final String serializeDefault()
Serializes this ArgbColor instance to the most appropriate CSS function notation depending on translucency
serializeDefault in interface ICssDataTypepublic final String toRGB()
Serializes this ArgbColor instance to the 'rgb' CSS function notation
public final String toRGBA()
Serializes this ArgbColor instance to the 'rgba' CSS function notation
public String toString()
Same as serializeDefault()
toString in class ObjectserializeDefault()Copyright © 2024. All rights reserved.