adjust colour php functions
This commit is contained in:
@@ -10,6 +10,8 @@ class Colour
|
|||||||
|
|
||||||
if($colour == 'black'):
|
if($colour == 'black'):
|
||||||
$hex = '#000000';
|
$hex = '#000000';
|
||||||
|
elseif($colour == 'grey'):
|
||||||
|
$hex = '#808080';
|
||||||
elseif($colour == 'white'):
|
elseif($colour == 'white'):
|
||||||
$hex = '#FFFFFF';
|
$hex = '#FFFFFF';
|
||||||
else:
|
else:
|
||||||
@@ -27,20 +29,23 @@ class Colour
|
|||||||
|
|
||||||
public function values()
|
public function values()
|
||||||
{
|
{
|
||||||
$colours = get_field('badegg_colours', 'option');
|
|
||||||
|
|
||||||
$values = [];
|
$values = [];
|
||||||
|
|
||||||
if($colours):
|
if(function_exists('get_field')):
|
||||||
foreach($colours as $index => $props):
|
$colours = get_field('badegg_colours', 'option');
|
||||||
$index = $index + 1;
|
|
||||||
$hex = @$props['hex'];
|
|
||||||
|
|
||||||
if($hex) $values[$this->latinate($index)] = $hex;
|
if($colours):
|
||||||
endforeach;
|
foreach($colours as $index => $props):
|
||||||
|
$index = $index + 1;
|
||||||
|
$hex = @$props['hex'];
|
||||||
|
|
||||||
|
if($hex) $values[$this->latinate($index)] = $hex;
|
||||||
|
endforeach;
|
||||||
|
endif;
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
$values['white'] = '#FFFFFF';
|
$values['white'] = '#FFFFFF';
|
||||||
|
$values['grey'] = '#808080';
|
||||||
$values['black'] = '#000000';
|
$values['black'] = '#000000';
|
||||||
|
|
||||||
return $values;
|
return $values;
|
||||||
@@ -49,13 +54,13 @@ class Colour
|
|||||||
public function tints()
|
public function tints()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'lightest' => 100,
|
'lightest' => 40,
|
||||||
'lighter' => 66,
|
'lighter' => 25,
|
||||||
'light' => 33,
|
'light' => 10,
|
||||||
'0' => 0,
|
'0' => 0,
|
||||||
'dark' => -33,
|
'dark' => -10,
|
||||||
'darker' => -66,
|
'darker' => -25,
|
||||||
'darkest' => -100,
|
'darkest' => -40,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user