From ffee2bbdd4ec7bcfba0dec567149e6961240063d Mon Sep 17 00:00:00 2001 From: Mathieu De Keyzer Date: Tue, 10 Oct 2023 23:02:16 +0200 Subject: [PATCH] ref: use ems colors --- .../src/Controller/ContentManagement/FileController.php | 6 ++++-- .../src/Resources/views/ems-core/browserconfig.xml.twig | 2 +- .../src/Resources/views/ems-core/site.webmanifest.twig | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/EMS/core-bundle/src/Controller/ContentManagement/FileController.php b/EMS/core-bundle/src/Controller/ContentManagement/FileController.php index 76e540d49..79257ba1f 100644 --- a/EMS/core-bundle/src/Controller/ContentManagement/FileController.php +++ b/EMS/core-bundle/src/Controller/ContentManagement/FileController.php @@ -184,14 +184,16 @@ public function icon(Request $request, int $width, int $height): Response EmsFields::ASSET_CONFIG_WIDTH => $width, EmsFields::ASSET_CONFIG_HEIGHT => $height, EmsFields::ASSET_CONFIG_QUALITY => 0, - EmsFields::ASSET_CONFIG_BACKGROUND => $this->themeColor, + EmsFields::ASSET_CONFIG_BACKGROUND => "ems-$this->themeColor", + EmsFields::ASSET_CONFIG_RADIUS => $width / 6, + EmsFields::ASSET_CONFIG_BORDER_COLOR => '#000000FF', ]); } else { $image = $this->fileService->generateImage('@EMSCommonBundle/Resources/public/images/ems-logo.png', [ EmsFields::ASSET_CONFIG_WIDTH => $width, EmsFields::ASSET_CONFIG_HEIGHT => $height, EmsFields::ASSET_CONFIG_QUALITY => 0, - EmsFields::ASSET_CONFIG_COLOR => $this->themeColor, + EmsFields::ASSET_CONFIG_COLOR => "ems-$this->themeColor", ]); } diff --git a/EMS/core-bundle/src/Resources/views/ems-core/browserconfig.xml.twig b/EMS/core-bundle/src/Resources/views/ems-core/browserconfig.xml.twig index 48de8e4f7..4c37ad39d 100644 --- a/EMS/core-bundle/src/Resources/views/ems-core/browserconfig.xml.twig +++ b/EMS/core-bundle/src/Resources/views/ems-core/browserconfig.xml.twig @@ -3,7 +3,7 @@ - {{ themeColor|ems_color.rgb }} + {{ "ems-#{themeColor}"|ems_color.rgb }} diff --git a/EMS/core-bundle/src/Resources/views/ems-core/site.webmanifest.twig b/EMS/core-bundle/src/Resources/views/ems-core/site.webmanifest.twig index 437f45f74..650af43c1 100644 --- a/EMS/core-bundle/src/Resources/views/ems-core/site.webmanifest.twig +++ b/EMS/core-bundle/src/Resources/views/ems-core/site.webmanifest.twig @@ -13,8 +13,8 @@ "type": "image/png" } ], - "theme_color": themeColor|ems_color.rgb, - "background_color": themeColor|ems_color.rgb, + "theme_color": "ems-#{themeColor}"|ems_color.rgb, + "background_color": "ems-#{themeColor}"|ems_color.rgb, "display": "standalone" } -%} {{ data|json_encode|raw }}