Docs (4.0.0)
class UIColor method

isBrightColor

Returns true if the pseudo-brightness of the specified color is greater than 55%.

static

static isBrightColor(color: UIColor | string): boolean

Notes

  • This method is used by the UIColor.text() method to determine a suitable text color.

Parameters

  • color — A color value, in hex format #112233 or #123, or rgb(a) format rgb(255, 255, 255)

Return value

True if the specified color has a relatively high perceived brightness.

Related