Skip to content

Conversation

@t-schroeder
Copy link
Collaborator

Make activity icons black before applying color filters for final color.

Looking at https://codepen.io/sosuke/pen/Pjoqqp (which I assume the CSS filter calculation is based on, same as in Moodle core up until 5.0 (see MDL-83725)) I saw this paragraph:

For this code to work well the starting color needs to be black. If your icon set isn't black you can prepend "brightness(0) saturate(100%)" to your filter property which will first turn the icon set to black.

In Moodle 4.4 (see MDL-78284) the core activity icons got replaced by new non-black ones. Therefore the CSS filters result in incorrect colors. For some colors this difference is actually noticeable, especially if you have third-party activities with icons with base color black next to core activities with icons with this non-black base color. I'm fixing this in Moodle core through MDL-84306 and it is necessary to apply that same fix here.

@t-schroeder
Copy link
Collaborator Author

t-schroeder commented Feb 18, 2025

This is how the color ended up for me with:

setting value
activityiconcolorassessment #5B40FF
activityiconcolorfidelity One shot (1 iteration)

image

@t-schroeder t-schroeder marked this pull request as draft February 18, 2025 20:33


Make activity icons black before applying color filters for final color.
@abias abias force-pushed the MOODLE_404_STABLE branch from 1c18d91 to 82b4e73 Compare March 6, 2025 20:30
@abias abias force-pushed the MOODLE_404_STABLE branch from 3567aa8 to 012b7ef Compare March 24, 2025 16:41
@wiebkemueller-hsh wiebkemueller-hsh linked an issue Mar 27, 2025 that may be closed by this pull request
@abias
Copy link
Member

abias commented Apr 29, 2025

Thank you, @t-schroeder , for this PR.
As I have just commented in #831 (comment), I would like to wait for final feedback by Moodle HQ if this issue will be solved upstream in Boost Core or not. We will keep this PR on hold until then.

@abias abias force-pushed the MOODLE_404_STABLE branch from 1499bb9 to 8d84b9d Compare May 30, 2025 19:17
@abias
Copy link
Member

abias commented Jul 1, 2025

Hi @t-schroeder , I stumbled again over this PR and looked at https://moodle.atlassian.net/browse/MDL-84306 again. Unfortunately, HQ did not reply there. Would you want to ping Ferran from your side again there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Activity icon colors are not accurate

2 participants