Skip to content

color: add per-role overrides to MdColorMgr - #41

Open
wehrwolfmann wants to merge 1 commit into
hypengw:mainfrom
wehrwolfmann:color/overrides
Open

wehrwolfmann wants to merge 1 commit into
hypengw:mainfrom
wehrwolfmann:color/overrides

Conversation

@wehrwolfmann

Copy link
Copy Markdown
Contributor

Adds MdColorMgr.overrides, a map of role name to color (QColor or "#rrggbb") applied on top of the generated scheme. It lets an app that embeds QmlMaterial pin surfaces and text to its own palette while keeping the rest of the scheme.
Roles are listed once in QM_SCHEME_ROLES, which now also declares MdScheme; unknown names are ignored with a warning. With an empty map the scheme is unchanged.
Test: tests/token/color_overrides.cpp.

`overrides` maps a role name to a color and is applied on top of the
generated scheme, so an embedding app can pin surfaces and text to its
own palette. Roles are listed once in QM_SCHEME_ROLES; unknown names are
ignored with a warning. Empty map keeps the scheme unchanged.

This branch has not been deployed

No deployments
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.

1 participant