• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
WordPress a2z

WordPress a2z

WordPress Dynamic API Reference

  • Home
  • Plugins
  • Themes
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / twentytwenty_get_color_for_area() – Get accessible color for an area.

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;
}
 

 View on GitHub View on Trac

Published: 25th November 2019 | Last updated: 25th November 2019

Primary Sidebar

Information

Function name: twentytwenty_get_color_for_area
Plugin ref: Twenty Twenty
Version: 1.6
Sourcefile: functions.php
File ref: functions.php
Deprecated?: No
API Letters: A,C,F,G,T

Footer

WordPress a2z
WordPress a2z
WordPress Dynamic API Reference
WordPress 5.6.2. PHP: 7.3.27
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  wp-a2z.org
© Copyright WordPress a2z 2014-2021. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites