added in version 22.1.0
belongs to Maven artifact com.android.support:palette-v7:28.0.0-alpha1
belongs to Maven artifact com.android.support:palette-v7:28.0.0-alpha1
Palette.Swatch
public
static
final
class
Palette.Swatch
extends Object
java.lang.Object | |
↳ | android.support.v7.graphics.Palette.Swatch |
Represents a color swatch generated from an image's palette. The RGB color can be retrieved
by calling getRgb()
.
Summary
Public constructors | |
---|---|
Palette.Swatch(int color, int population)
|
Public methods | |
---|---|
boolean
|
equals(Object o)
|
int
|
getBodyTextColor()
Returns an appropriate color to use for any 'body' text which is displayed over this
|
float[]
|
getHsl()
Return this swatch's HSL values. |
int
|
getPopulation()
|
int
|
getRgb()
|
int
|
getTitleTextColor()
Returns an appropriate color to use for any 'title' text which is displayed over this
|
int
|
hashCode()
|
String
|
toString()
|
Inherited methods | |
---|---|
![]()
java.lang.Object
|
Public constructors
Palette.Swatch
added in version 22.1.0
Palette.Swatch (int color, int population)
Parameters | |
---|---|
color |
int |
population |
int |
Public methods
equals
boolean equals (Object o)
Parameters | |
---|---|
o |
Object |
Returns | |
---|---|
boolean |
getBodyTextColor
added in version 22.1.0
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.