| java.lang.Object | |
| ↳ | android.support.v4.graphics.ColorUtils |
A set of color-related utility methods, building upon those available in Color.
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Convert HSL (hue-saturation-lightness) components to a RGB color.
| |||||||||||
Convert RGB components to HSL (hue-saturation-lightness).
| |||||||||||
Returns the contrast ratio between
foreground and background.
| |||||||||||
Returns the luminance of a color.
| |||||||||||
Calculates the minimum alpha value which can be applied to
foreground so that would
have a contrast value of at least minContrastRatio when compared to
background.
| |||||||||||
Convert the ARGB color to its HSL (hue-saturation-lightness) components.
| |||||||||||
Composite two potentially translucent colors over each other and returns the result.
| |||||||||||
Set the alpha component of
color to be alpha.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Convert HSL (hue-saturation-lightness) components to a RGB color.
| hsl | 3 element array which holds the input HSL components. |
|---|
Convert RGB components to HSL (hue-saturation-lightness).
| r | red component value [0..255] |
|---|---|
| g | green component value [0..255] |
| b | blue component value [0..255] |
| hsl | 3 element array which holds the resulting HSL components. |
Returns the contrast ratio between foreground and background.
background must be opaque.
Formula defined here.
Returns the luminance of a color. Formula defined here: http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
Calculates the minimum alpha value which can be applied to foreground so that would
have a contrast value of at least minContrastRatio when compared to
background.
| foreground | the foreground color. |
|---|---|
| background | the background color. Should be opaque. |
| minContrastRatio | the minimum contrast ratio. |
Convert the ARGB color to its HSL (hue-saturation-lightness) components.
| color | the ARGB color to convert. The alpha component is ignored. |
|---|---|
| hsl | 3 element array which holds the resulting HSL components. |
Composite two potentially translucent colors over each other and returns the result.
Set the alpha component of color to be alpha.