public class Argb32Color extends Object
| Modifier and Type | Field and Description |
|---|---|
static Argb32Color |
EMPTY |
static Argb32Color |
TRANSPARENT |
| Constructor and Description |
|---|
Argb32Color(int alpha,
int red,
int green,
int blue)
Private constructor, initializes ARGB channels.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Argb32Color other)
Compares this color with another Argb32Color.
|
boolean |
equals(Object obj)
Equality comparison with another Argb32Color.
|
boolean |
equals(Rgb24Color other)
Compares this color with a Rgb24Color.
|
static Argb32Color |
fromArgb(int argb)
Create an Argb32Color from a 32-bit ARGB int value (same as System.Drawing.Color.ToArgb()).
|
static Argb32Color |
fromRgb(int red,
int green,
int blue)
Create an opaque Argb32Color from RGB channels (alpha = 255).
|
static Argb32Color |
fromRgb24Color(Rgb24Color rgbColor)
Create Argb32Color from Rgb24Color with alpha set to 255.
|
static Argb32Color |
fromRgba(int red,
int green,
int blue,
int alpha)
Create an Argb32Color from individual RGBA channels.
|
static Argb32Color |
fromSingleValueRgb(int value)
Create a grayscale opaque Argb32Color from a single value applied to R, G, B.
|
int |
getAlpha()
Returns the alpha channel [0..255]
|
double |
getAlphaFraction()
Returns the alpha channel as fraction [0..1]
|
int |
getArgbValue()
Returns the 32-bit ARGB integer value
|
int |
getBlue()
Returns the blue channel [0..255]
|
float |
getBrightness()
Calculates brightness/lightness of the color (HSL model).
|
int |
getGreen()
Returns the green channel [0..255]
|
float |
getHue()
Calculates hue of the color in degrees [0..360].
|
int |
getRed()
Returns the red channel [0..255]
|
float |
getSaturation()
Calculates saturation of the color (HSL model).
|
int |
getValue()
Gets the 32-bit signed integer representation of this color.
|
int |
hashCode() |
boolean |
isDefault()
Indicates if instance is default (Transparent) - all 4 channels are set to 0.
|
boolean |
isEmpty()
Indicates if this color is empty (all channels 0)
|
boolean |
isFullyOpaque()
Indicates if this color is fully opaque (alpha == 255)
|
boolean |
isFullyTransparent()
Indicates if this color is fully transparent (alpha == 0)
|
boolean |
isTranslucent()
Indicates if this color is translucent (alpha between 1 and 254)
|
int |
toArgb()
Returns the 32-bit ARGB value of this color instance, compatible with System.Drawing.Color.ToArgb()
|
String |
toHexRGB()
Serializes this instance to hexadecimal #RRGGBB notation (without alpha).
|
String |
toHexRGBA()
Serializes this instance to hexadecimal #RRGGBBAA notation.
|
String |
toRGB()
Serializes this instance to CSS rgb() string notation (without alpha).
|
Rgb24Color |
toRgb24Color()
Cast this Argb32Color to Rgb24Color, losing alpha channel.
|
String |
toRGBA()
Serializes this Argb32Color instance to the 'rgba' CSS function notation.
|
String |
toString()
Returns the string representation using the most appropriate CSS notation.
|
public static final Argb32Color EMPTY
public static final Argb32Color TRANSPARENT
public Argb32Color(int alpha,
int red,
int green,
int blue)
alpha - alpha channel (0-255)red - red channel (0-255)green - green channel (0-255)blue - blue channel (0-255)public boolean equals(Argb32Color other)
public boolean equals(Object obj)
public boolean equals(Rgb24Color other)
public static Argb32Color fromArgb(int argb)
public static Argb32Color fromRgb(int red, int green, int blue)
public static Argb32Color fromRgb24Color(Rgb24Color rgbColor)
public static Argb32Color fromRgba(int red, int green, int blue, int alpha)
public static Argb32Color fromSingleValueRgb(int value)
public int getAlpha()
public double getAlphaFraction()
public int getArgbValue()
public int getBlue()
public float getBrightness()
public int getGreen()
public float getHue()
public int getRed()
public float getSaturation()
public int getValue()
public boolean isDefault()
public boolean isEmpty()
public boolean isFullyOpaque()
public boolean isFullyTransparent()
public boolean isTranslucent()
public int toArgb()
public String toHexRGB()
public String toHexRGBA()
public String toRGB()
public Rgb24Color toRgb24Color()
public String toRGBA()
Copyright © 2025. All rights reserved.