Identify a suitable font color (black or white) given a background HEX color

hex_bw(hex_code)

Source

Adapted from saros

Arguments

hex_code

Background color in hex-format.

Value

Either black or white, in hex-format

Examples

hex_bw("#0dadfd")
#> [1] "#000000"