public class Rgb24Color extends Object
| Constructor and Description |
|---|
Rgb24Color(int r,
int g,
int b)
Private constructor to create a color from red, green, and blue channels.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
static Rgb24Color |
fromRgb(int red,
int green,
int blue)
Creates a new Rgb24Color from specified red, green, and blue channel values.
|
int |
getB()
Gets the blue channel value.
|
float |
getBrightness()
Calculates the brightness (lightness) of this color in HSL color space.
|
int |
getG()
Gets the green channel value.
|
float |
getHue()
Calculates the hue of this color in degrees (HSL color space).
|
int |
getR()
Gets the red channel value.
|
float |
getSaturation()
Calculates the saturation of this color in HSL color space.
|
int |
hashCode() |
boolean |
isDefault()
Returns true if the color is the default black color (all channels are zero).
|
int |
toArgb()
Returns the 32-bit ARGB representation of this color.
|
String |
toHex()
Returns the hexadecimal string representation of the color.
|
String |
toRGB()
Returns the CSS rgb() function string representation of the color.
|
String |
toString() |
public Rgb24Color(int r,
int g,
int b)
public static Rgb24Color fromRgb(int red, int green, int blue)
red - Red channel valuegreen - Green channel valueblue - Blue channel valuepublic int getB()
public float getBrightness()
public int getG()
public float getHue()
public int getR()
public float getSaturation()
public boolean isDefault()
public int toArgb()
public String toHex()
public String toRGB()
Copyright © 2025. All rights reserved.