Add colors from palette support to the button

[MAILPOET-5741]
This commit is contained in:
Rostislav Wolny
2024-02-20 17:03:53 +01:00
committed by Rostislav Wolný
parent 299d51effa
commit 875fde56e9
5 changed files with 58 additions and 1 deletions

View File

@ -188,4 +188,14 @@ class SettingsController {
}
return $fontSize;
}
public function translateSlugToColor(string $colorSlug): string {
$settings = $this->getTheme()->get_settings();
foreach ($settings['color']['palette']['default'] as $colorDefinition) {
if ($colorDefinition['slug'] === $colorSlug) {
return $colorDefinition['color'];
}
}
return $colorSlug;
}
}