You appear to be a bot. Output may be restricted
Description
Determine the luminance of the given color and then return #fff or #000 so that the text is always readable.
Usage
$string = Twenty_Twenty_One_Custom_Colors::custom_get_readable_color( $background_color );
Parameters
- $background_color
- ( string ) required – The background color.
Returns
string (hex color)
Source
File name: twentytwentyone/classes/class-twenty-twenty-one-custom-colors.php
Lines:
1 to 3 of 3
public function custom_get_readable_color( $background_color ) { return ( 127 < self::get_relative_luminance_from_hex( $background_color ) ) ? '#000' : '#fff'; }