<?php
function block_core_home_link_build_css_colors( $context ) {
$colors = array(
'css_classes' => array(),
'inline_styles' => '',
);
$has_named_text_color = array_key_exists( 'textColor', $context );
$has_custom_text_color = isset( $context['style']['color']['text'] );
if ( $has_custom_text_color || $has_named_text_color ) {
$colors['css_classes'][] = 'has-text-color';
}
if ( $has_named_text_color ) {
$colors['css_classes'][] = sprintf( 'has-%s-color', $context['textColor'] );
} elseif ( $has_custom_text_color ) {
$colors['inline_styles'] .= sprintf( 'color: %s;', $context['style']['color']['text'] );
}
$has_named_background_color = array_key_exists( 'backgroundColor', $context );
$has_custom_background_color = isset( $context['style']['color']['background'] );