1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-08-04 04:28:30 -04:00

feat(media): add toggle for album art accent colors (#2831) (#2832)

* fix(media): use system colours in player instead of album cover accent

Closes #2831

Removes ColorQuantizer-based album art accent extraction from
MediaAccentService. All accent properties now return Theme.primary
and Theme.onPrimary directly, so the Dank Dash player always
matches the system colour scheme.

Blame: ee6f7b47 (introduced MediaAccentService & ColorQuantizer)
       d799175c (tweaked seekbar accent colours)
       a62ae336 (further integrated accent into player/album art)
       c44ffae7 (monochrome art edge case fixes)

* feat(media): add toggle for album art accent colours (#2831)

Adds mediaUseAlbumArtAccent setting (default: off) to Settings.
When enabled, MediaAccentService extracts accent from album art
via ColorQuantizer. When disabled, uses Theme.primary.
Toggle is in Settings > Media Player.

* fix: use american english spelling (colour -> color)

Port 1.5
This commit is contained in:
Huỳnh Thiện Lộc
2026-07-12 09:29:35 +07:00
committed by GitHub
parent 71ab752e1b
commit e2b3a2e3ca
4 changed files with 14 additions and 6 deletions
+5 -6
View File
@@ -11,14 +11,13 @@ import qs.Services
Singleton {
id: root
readonly property bool hasAccent: _accent !== null
readonly property color accent: _accent !== null ? _accent : Theme.primary
readonly property bool hasAccent: SettingsData.mediaUseAlbumArtAccent ? _accent !== null : true
readonly property color accent: SettingsData.mediaUseAlbumArtAccent && _accent !== null ? _accent : Theme.primary
readonly property color onAccent: {
const c = accent;
const lum = 0.2126 * c.r + 0.7152 * c.g + 0.0722 * c.b;
readonly property color onAccent: SettingsData.mediaUseAlbumArtAccent && _accent !== null ? (() => {
const lum = 0.2126 * _accent.r + 0.7152 * _accent.g + 0.0722 * _accent.b;
return lum > 0.6 ? Qt.rgba(0, 0, 0, 1) : Qt.rgba(1, 1, 1, 1);
}
})() : Theme.onPrimary
readonly property color accentHover: Theme.withAlpha(accent, 0.12)
readonly property color accentPressed: Theme.withAlpha(accent, Theme.transparentBlurLayers ? 0.24 : 0.16)