Palette.Swatch
public final class Palette.Swatch
Represents a color swatch generated from an image's palette. The RGB color can be retrieved by calling getRgb.
Summary
Public methods |
|
|---|---|
boolean |
|
@ColorInt int |
Returns an appropriate color to use for any 'body' text which is displayed over this |
@NonNull 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() |
@NonNull String |
toString() |
Public methods
getBodyTextColor
public @ColorInt int getBodyTextColor()
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
public @NonNull float[] getHsl()
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
public int getPopulation()
| Returns | |
|---|---|
int |
the number of pixels represented by this swatch |
getRgb
public @ColorInt int getRgb()
| Returns | |
|---|---|
@ColorInt int |
this swatch's RGB color value |
getTitleTextColor
public @ColorInt int getTitleTextColor()
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.