Palette.Swatch
public
static
final
class
Palette.Swatch
extends Object
java.lang.Object
|
↳ |
androidx.palette.graphics.Palette.Swatch
|
Represents a color swatch generated from an image's palette. The RGB color can be retrieved
by calling getRgb()
.
Summary
Inherited methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
Public constructors
Palette.Swatch
public Palette.Swatch (int color,
int population)
Parameters |
color |
int |
population |
int |
Public methods
equals
public boolean equals (Object o)
getBodyTextColor
public int getBodyTextColor ()
Returns an appropriate color to use for any 'body' text which is displayed over this
Palette.Swatch
's color. This color is guaranteed to have sufficient contrast.
getHsl
public 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 int getRgb ()
Returns |
int |
this swatch's RGB color value
|
getTitleTextColor
public int getTitleTextColor ()
Returns an appropriate color to use for any 'title' text which is displayed over this
Palette.Swatch
's color. This color is guaranteed to have sufficient contrast.
hashCode
public int hashCode ()
toString
public String toString ()