Palette.Swatch
class Palette.Swatch
Represents a color swatch generated from an image's palette. The RGB color can be retrieved by calling getRgb.
Summary
Public functions |
|
|---|---|
Boolean |
|
@ColorInt Int |
Returns an appropriate color to use for any 'body' text which is displayed over this |
FloatArray<Float> |
getHsl()Return this swatch's HSL values. hsv[0] is Hue [0 .. |
Int |
|
@ColorInt Int |
getRgb() |
@ColorInt Int |
Returns an appropriate color to use for any 'title' text which is displayed over this |
Int |
hashCode() |
String! |
toString() |
Public functions
getBodyTextColor
fun getBodyTextColor(): @ColorInt Int
Returns an appropriate color to use for any 'body' text which is displayed over this Swatch's color. This color is guaranteed to have sufficient contrast.
getHsl
fun getHsl(): FloatArray<Float>
Return this swatch's HSL values. hsv[0] is Hue [0 .. 360) hsv[1] is Saturation [0...1] hsv[2] is Lightness [0...1]
getPopulation
fun getPopulation(): Int
| Returns | |
|---|---|
Int |
the number of pixels represented by this swatch |
getTitleTextColor
fun getTitleTextColor(): @ColorInt Int
Returns an appropriate color to use for any 'title' text which is displayed over this Swatch's color. This color is guaranteed to have sufficient contrast.