You appear to be a bot. Output may be restricted
Description
Get accessible color for an area.
Usage
$string = twentytwenty_get_color_for_area( $area, $context );
Parameters
- $area
- ( string ) optional default: content – The area we want to get the colors for.
- $context
- ( string ) optional default: text – Can be 'text' or 'accent'.
Returns
string Returns a HEX color.
Source
File name: twentytwenty/functions.php
Lines:
1 to 29 of 29
function twentytwenty_get_color_for_area( $area = 'content', $context = 'text' ) { // Get the value from the theme-mod. $settings = get_theme_mod( 'accent_accessible_colors', array( 'content' => array( 'text' => '#000000', 'accent' => '#cd2653', 'secondary' => '#6d6d6d', 'borders' => '#dcd7ca', ), 'header-footer' => array( 'text' => '#000000', 'accent' => '#cd2653', 'secondary' => '#6d6d6d', 'borders' => '#dcd7ca', ), ) ); // If we have a value return it. if ( isset( $settings[ $area ] ) && isset( $settings[ $area ][ $context ] ) ) { return $settings[ $area ][ $context ]; } // Return false if the option doesn't exist. return false; }