text
Returns a new UIColor instance for a suitable text color (black or white).
text(): UIColor
Notes
- This method uses theme colors to determine a contrasting text color for the current color.
- Set UITheme.darkTextColor and UITheme.lightTextColor to override the default black and white text colors.
Return value
A new instance of UIColor.
Example
// Using a suitable text color on the primary theme background color
ui.cell(
{
background: ui.color.PRIMARY_BG,
textColor: ui.color.PRIMARY_BG.text()
},
// ...
)
Related
- class UIColorAn object that represents a single color value.