From c46fc58be5764a5865d50b10494d7e5b5d16f5a2 Mon Sep 17 00:00:00 2001
From: Jan-Hendrik Willms <tleilax+studip@gmail.com>
Date: Thu, 15 Jun 2023 09:30:41 +0000
Subject: [PATCH] create other icons from the blue ones, fixes #2091

Closes #2091

Merge request studip/studip!1541
---
 Makefile | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index ea261aafd39..00e34c12684 100644
--- a/Makefile
+++ b/Makefile
@@ -77,8 +77,19 @@ test-unit: $(CODECEPT)
 
 catalogs: npm $(CATALOGS)
 
+clean-icons:
+	find public/assets/images/icons -type f -not -path '*blue*' -delete
+
 optimize-icons: npm
-	find public/assets/images/icons -type f | xargs -P0 npx svgo -q --config=config/svgo.config.js
+	find public/assets/images/icons/blue -type f | xargs -P0 npx svgo -q --config=config/svgo.config.js
+
+icons: optimize-icons
+	find public/assets/images/icons/blue -type f -print0 | xargs -0 -n1 -I{} echo 'sed "s/#28497c/#000000/" {} > {}' | sed 's#icons/blue#icons/black#2' | sh
+	find public/assets/images/icons/blue -type f -print0 | xargs -0 -n1 -I{} echo 'sed "s/#28497c/#00962d/" {} > {}' | sed 's#icons/blue#icons/green#2' | sh
+	find public/assets/images/icons/blue -type f -print0 | xargs -0 -n1 -I{} echo 'sed "s/#28497c/#6e6e6e/" {} > {}' | sed 's#icons/blue#icons/grey#2' | sh
+	find public/assets/images/icons/blue -type f -print0 | xargs -0 -n1 -I{} echo 'sed "s/#28497c/#cb1800/" {} > {}' | sed 's#icons/blue#icons/red#2' | sh
+	find public/assets/images/icons/blue -type f -print0 | xargs -0 -n1 -I{} echo 'sed "s/#28497c/#ffffff/" {} > {}' | sed 's#icons/blue#icons/white#2' | sh
+	find public/assets/images/icons/blue -type f -print0 | xargs -0 -n1 -I{} echo 'sed "s/#28497c/#ffad00/" {} > {}' | sed 's#icons/blue#icons/yellow#2' | sh
 
 # default rules for gettext handling
 js-%.pot: $(VUE_SOURCES)
-- 
GitLab