Open lucaboesch opened 2 months ago
Since this method was introduced into Moodle, browsers have added wider support for the CSS Masks feature, which is possible a more straightforward way to recolor black and white icons now. Though you can't directly apply it to img tags, which might be a drawback.
For all institutions that use the coloring of the icons as a way to brand the site this is a blocker!
https://codepen.io/sosuke/pen/Pjoqqp and https://isotropic.co/tool/hex-color-to-css-filter are two resources that help translate hex code to filters. At least, that's what I did, and then I added
/* Moodle 4.4 modifications */
$activity-icon-administration-filter:
invert(34%) sepia(15%) saturate(1084%) hue-rotate(227deg) brightness(92%) contrast(90%) !default; /* #645078 */
$activity-icon-assessment-filter:
invert(58%) sepia(7%) saturate(1230%) hue-rotate(238deg) brightness(96%) contrast(88%) !default; /* #a087aa */
$activity-icon-collaboration-filter:
invert(54%) sepia(79%) saturate(671%) hue-rotate(317deg) brightness(80%) contrast(108%) !default; /* #d25a50 */
$activity-icon-communication-filter:
invert(56%) sepia(7%) saturate(1650%) hue-rotate(81deg) brightness(97%) contrast(80%) !default; /* #699673 */
$activity-icon-content-filter:
invert(57%) sepia(40%) saturate(421%) hue-rotate(162deg) brightness(96%) contrast(82%) !default; /* #699bbe */
$activity-icon-interactivecontent-filter:
invert(34%) sepia(15%) saturate(1084%) hue-rotate(227deg) brightness(92%) contrast(90%) !default; /* #645078 */
to Raw initial SCSS. This to whom is interested in a manual workaround.
Under https://wiki.cgx.me/code/php/colorsolver there's an approach using PHP, openly licenced https://www.shaftinc.fr/misc/licence-iv.txt which in its terms and conditions says
🤣
[laugh] Wiebke Müller reacted to your message:
From: Luca Bösch @.> Sent: Tuesday, June 4, 2024 11:44:26 AM To: moodle-an-hochschulen/moodle-theme_boost_union @.> Cc: Wiebke Müller @.>; Comment @.> Subject: [EXTERN] Re: [moodle-an-hochschulen/moodle-theme_boost_union] Enable to set activity icon outline colors (Issue #631)
Under https://wiki.cgx.me/code/php/colorsolver there's an approach using PHP, openly licenced https://www.shaftinc.fr/misc/licence-iv.txt which in its terms and conditions says
🤣
— Reply to this email directly, view it on GitHubhttps://github.com/moodle-an-hochschulen/moodle-theme_boost_union/issues/631#issuecomment-2147324055, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ARJQDRIYKDAB3YNZAGHHG6TZFWSBVAVCNFSM6AAAAABGJCSBE2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBXGMZDIMBVGU. You are receiving this because you commented.Message ID: @.***>
In Moodle 4.4 activity icons will be shown as outlines.
The colors of those outlines will be set not with RGB hex values but like such:
invert(33%) sepia(8%) saturate(2138%) hue-rotate(227deg) brightness(92%) contrast(82%) !default;
This issue is about not forgetting to create settings to be able to modify those values.