AvengeMedia / AvengeMedia/DankMaterialShell
dank16: light-mode color8 is near-black because the light variant is derived from the dark surface
- Dominant language
- QML
- Stars
- 8.1k
- Forks
- 515
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 102
Description
### Compositor
Niri
### Distribution
Fedora
### If Other, please specify
_No response_
### Select your Installation Method
Distro Packaging
### Was this your original Installation method?
Yes
### If no, specify
_No response_
### dms doctor -vC
dms doctor -v (home directory shortened to ~)
```
System Health Check
──────────────────────────────────────
System
● Operating System ····· Fedora Linux 44 (Forty Four)
└─ ID: fedora, Version: 44, Arch: amd64
● Architecture ········· amd64
● Display Server ······· Wayland
└─ WAYLAND_DISPLAY=wayland-1
Versions
● DMS CLI ·············· dms v1.6.1
└─ /usr/bin/dms
● Quickshell ··········· Quickshell 0.3.1 (revision , distributed by Fedora COPR (avengemedia/quickshell))
└─ /usr/bin/qs
● DMS Shell ············ v1.6.1
└─ /run/user/1000/danklinux-shell/d83248ba9119b48a
Installation
● DMS Configuration ···· Found
└─ /run/user/1000/danklinux-shell/d83248ba9119b48a
● shell.qml ············ Present
└─ /run/user/1000/danklinux-shell/d83248ba9119b48a/shell.qml
○ Install Type ········· Unknown
└─ /run/user/1000/danklinux-shell/d83248ba9119b48a
Compositor
● niri ················· 26.04
└─ /usr/bin/niri
○ Active ··············· niri
● Background Blur ······ Supported
└─ Compositor supports ext-background-effect-v1
Quickshell Features
● Polkit ··············· Available
└─ Authentication prompts
● IdleMonitor ·········· Available
└─ Idle detection
● IdleInhibitor ········ Available
└─ Prevent idle/sleep
● ShortcutInhibitor ···· Available
└─ Allow shortcut management (niri)
● BackgroundBlur ······· Available
└─ Background blur API support in Quickshell
Optional Features
● accountsservice ······ Available
└─ User accounts
● power-profiles-daemon Available
└─ Power profile management
● logind ··············· Available
└─ Session management
● cups-pk-helper ······· Available
└─ Printer management
○ I2C/DDC ·············· No monitors detected
└─ External monitor brightness control
● qt6-imageformats ····· Installed (5 formats)
└─ Formats: WebP, TIFF, GIF, JP2, ICNS (/usr/lib64/qt6/plugins/imageformats)
● kimageformats ········ Installed (4 formats)
└─ Formats: AVIF, HEIF, JXL, EXR (/usr/lib64/qt6/plugins/imageformats)
● Terminal ············· kitty
● Network ·············· NetworkManager
└─ NetworkManager present. Using NM API.
● matugen ·············· Installed
└─ Dynamic theming
● cava ················· Installed
└─ Audio visualizer
○ khal ················· Not installed
└─ Calendar events
● danksearch ··········· Installed
└─ File search
○ dankcalendar ········· Not installed
└─ Calendar app
○ fprintd ·············· Not installed
└─ Fingerprint auth
● adw-gtk3 ············· Installed
└─ GTK3 dynamic theming (user copy)
Config Files
● settings.json ········ Present
└─ ~/.config/DankMaterialShell/settings.json
○ clsettings.json ······ Not yet created
└─ ~/.config/DankMaterialShell/clsettings.json
● plugin_settings.json · Present
└─ ~/.config/DankMaterialShell/plugin_settings.json
● session.json ········· Present
└─ ~/.local/state/DankMaterialShell/session.json
● dms-colors.json ······ Present
└─ ~/.cache/DankMaterialShell/dms-colors.json
Services
● dms.service ·········· enabled, active
● greetd ··············· enabled
Environment
○ QT_QPA_PLATFORMTHEME · qt6ct
● qt6ct plugin (Qt6) ··· Installed
└─ /usr/lib64/qt6/plugins/platformthemes/libqt6ct.so
○ QT_QPA_PLATFORMTHEME… Not set
○ QS_ICON_THEME ········ Not set
● XDG_MENU_PREFIX ······ plasma- (menu file not found)
└─ Dolphin 'Open with…' dialog may be empty. Ensure /etc/xdg/menus/plasma-applications.menu exists.
→ https://danklinux.com/docs/dankmaterialshell/cli-doctor#xdg-menu-prefix
Fonts
● Normal Font ·········· Rubik
└─ Available via fontconfig
● Monospace Font ······· JetBrainsMono Nerd Font Mono
└─ Available via fontconfig
──────────────────────────────────────
1 warning(s), 36 ok
```
### Description
With a dynamic (matugen) theme in light mode, dank16 `color8` (bright black) comes out near-black instead of a dim gray. In `~/.config/kitty/dank-theme.conf` it is `#000203` on a `#f5fafc` background (19.8:1), while in dark mode `color8` is a dim `#3e4346` (~1.8:1). Terminal apps that use bright black for dim or secondary text get the strongest colour in the palette instead.
**Cause**
- `generateDank16Variants` receives `surface` from `extractMatugenColor(matJSON, "surface", "dark")` ([matugen.go:406](https://github.com/AvengeMedia/DankMaterialShell/blob/f864dc22338e3f5c81f14478f4566f6a1717f982/core/internal/matugen/matugen.go#L406), also [:376](https://github.com/AvengeMedia/DankMaterialShell/blob/f864dc22338e3f5c81f14478f4566f6a1717f982/core/internal/matugen/matugen.go#L376) for stock themes) and uses it as `Background` for both variants ([dank16.go:705–706](https://github.com/AvengeMedia/DankMaterialShell/blob/f864dc22338e3f5c81f14478f4566f6a1717f982/core/internal/dank16/dank16.go#L705-L706)).
- `DeriveDim` (added in [7f2ba56](https://github.com/AvengeMedia/DankMaterialShell/commit/7f2ba56e066e3c7a4e4ac07e8a18adfed266256f) for #2987) offsets L* from that background, so the light variant subtracts 22 from a dark surface and clamps to black ([dank16.go:589](https://github.com/AvengeMedia/DankMaterialShell/blob/f864dc22338e3f5c81f14478f4566f6a1717f982/core/internal/dank16/dank16.go#L589)). `Background` also becomes `color0` ([dank16.go:551](https://github.com/AvengeMedia/DankMaterialShell/blob/f864dc22338e3f5c81f14478f4566f6a1717f982/core/internal/dank16/dank16.go#L551)), which is presumably why the dark surface is passed.
Reproduced on 5 wallpapers: light `color8` ranges 19.8–20.0:1 against the background.
### Expected Behavior
Light `color8` is a dim gray a similar distance from the light background, as in dark mode (step 3 gives `#b7bcbd`, 1.82:1).
### Steps to Reproduce
1. Use a wallpaper-based dynamic theme and switch DMS to light mode.
2. Check `color8` in the generated kitty theme, or run the same generation DMS does: `dms dank16 --variants --primary-dark --primary-light --background --json` and read `.color8.light`.
3. Compare with `dms dank16 --light --background --json`.
### Error Messages/Logs
_No response_
### Screenshots/Recordings
_No response_
Contributor guide
Research direction
Read core/internal/matugen/matugen.go at the surface extraction points and core/internal/dank16/dank16.go around DeriveDim, Background, and generateDank16Variants. Reproduce the issue with the three documented dms dank16 commands and compare .color8.light. Done means light-mode color8 is a dim gray with contrast near the dark-mode value instead of near-black.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100