Represents a label associated with a color for display purposes.
Public Constructors
Public Methods
static ColoredLabel |
create(String label, String displayName, Color color)
Creates a
ColoredLabel object with a Color instance. |
static ColoredLabel |
create(String label, String displayName, int argb)
Creates a
ColoredLabel object with an ARGB color int. |
abstract int |
getArgb()
Gets the ARGB int that represents the color.
|
Color | |
abstract String | |
abstract String |
getlabel()
|
Inherited Methods
Public Constructors
public ColoredLabel ()
Public Methods
public static ColoredLabel create (String label, String displayName, Color color)
Creates a ColoredLabel
object with a Color
instance.
Parameters
label | the label string, as provided in the label map packed in the TFLite Model Metadata. |
---|---|
displayName | the display name of label, as configured through ImageSegmenter.ImageSegmenterOptions.Builder.setDisplayNamesLocale(String) |
color | the color components for the label. The Color instatnce is supported on Android
API level 26 and above. For API level lower than 26, use create(String, String, int) . See Android
Color instances. for more details.
|
public static ColoredLabel create (String label, String displayName, int argb)
Creates a ColoredLabel
object with an ARGB color int.
Parameters
label | the label string, as provided in the label map packed in the TFLite Model Metadata. |
---|---|
displayName | the display name of label, as configured through ImageSegmenter.ImageSegmenterOptions.Builder.setDisplayNamesLocale(String) |
argb | the color components for the label in ARGB. See Android Color ints. for more details. |
public abstract int getArgb ()
Gets the ARGB int that represents the color.
See Android Color ints. for more details.
public Color getColor ()
Gets the Color
instance of the underlying color.
The Color instatnce is supported on Android API level 26 and above. For API level lower than
26, use getArgb()
. See Android
Color instances. for more details.