RGBInt
A representation of RGB that packs color components into a single integer.
This is an inline value class stores the color as a packed argb integer, such as those returned from android.graphics.Color.argb
or java.awt.image.BufferedImage.getRGB
.
This color always uses the sRGB color space.
You can destructure this class into r, g, b, and a components: val (r, g, b, a) = RGBInt(0xaa112233u)
Component | Description | Range |
---|---|---|
r | red | [0, 255] |
g | green | [0, 255] |
b | blue | [0, 255] |
Types
Default constructors for RGBInt.
Properties
Functions
Calculate the difference ΔEab between this color and other using the CIE 2000 recommendation.
Calculate the difference ΔEab between this color and other using the CIE 1976 recommendation.
Calculate the difference ΔEz between this color and other using the JzAzBz color space.
Return the first color with a contrast ratio exceeding the targetContrast against this color. If no color meets the target, black or white will be returned, whichever has the most contrast.
Return the first color with a contrast ratio greater or equal to the targetContrast against this color, or null
if no color meets the target.
Render this color in CSS functional notation.
Render this color in CSS functional notation if this color space is defined in the CSS standard, or return null if this color is in another color space.
Return true
if all channels of this color, when converted to sRGB, lie in the range [0, 1]
Return the color with the highest contrast ratio against this color.
Create a FloatArray containing all components of this color, with the alpha as the last component
Convert this color to an RGB hex string.
Calculate the contrast ration of this color with other according to the Web Content Accessibility Guidelines
Calculate the relative luminance of this color according to the Web Content Accessibility Guidelines