Skip to content
Commit 78ce302a authored by Volker Krause's avatar Volker Krause
Browse files

Add color and palette APIs for Grantlee

Summary:
This aims at enabling us to do the entire CSS styling via Grantlee, by
providing access to palette colors, by offering color operations and by
allowing to convert colors to CSS compatible strings.

Most of this is fairly straightforward, the ugly one is the colorMix
operator. I didn't find a way to do a two argument filter with both
arguments referencing variables. Therefore it's done as a tag, which means
chaining it to filters requires assigning it to a variable first. And while
color mixing isn't used in the current messagelib CSS generation, it's
heavily used in the Breeze style code (which is what I'm trying to follow
for the itinerary plug-in at least).

This isn't complete, there's more color operations in use in styling
(such as desaturate or tint), and this still misses KColorScheme access.
All that should be doable in a very similar fashion though, as needed.
Using FilterExpression for the two inputs of the colorMix operator might
also be an interesting future extension.

This works with the last Grantlee release, on Grantlee master it fails
without https://github.com/steveire/grantlee/pull/56.

Reviewers: skelly, kde-pim

Tags: #kde_pim

Differential Revision: https://phabricator.kde.org/D23585
parent bd289495
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment