diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-07-16 10:22:03 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-16 07:22:03 +0000 |
| commit | 3ace97660fde7fe1f0cc07a3925d1114af9a9c2f (patch) | |
| tree | 9d736a1d403875737566ad8817bb347a9e8056fe /wiki/Configuration:-Layout.md | |
| parent | 0824737757d10cbeb844871c3f67756ca969cf7c (diff) | |
| download | niri-3ace97660fde7fe1f0cc07a3925d1114af9a9c2f.tar.gz niri-3ace97660fde7fe1f0cc07a3925d1114af9a9c2f.tar.bz2 niri-3ace97660fde7fe1f0cc07a3925d1114af9a9c2f.zip | |
Implement gradient color interpolation option (#548)
* Added the better color averaging code (tested & functional)
* rustfmt
* Make Color f32 0..1, clarify premul/unpremul
* Fix imports and test name
* Premultiply gradient colors matching CSS
* Fix indentation
* fixup
* Add gradient image
---------
Co-authored-by: K's Thinkpad <K.T.Kraft@protonmail.com>
Diffstat (limited to 'wiki/Configuration:-Layout.md')
| -rw-r--r-- | wiki/Configuration:-Layout.md | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/wiki/Configuration:-Layout.md b/wiki/Configuration:-Layout.md index 04fe04b4..2eac03a5 100644 --- a/wiki/Configuration:-Layout.md +++ b/wiki/Configuration:-Layout.md @@ -32,7 +32,7 @@ layout { active-color "#ffc87f" inactive-color "#505050" // active-gradient from="#ffbb66" to="#ffc880" angle=45 relative-to="workspace-view" - // inactive-gradient from="#505050" to="#808080" angle=45 relative-to="workspace-view" + // inactive-gradient from="#505050" to="#808080" angle=45 relative-to="workspace-view" in="srgb-linear" } struts { @@ -169,7 +169,7 @@ layout { inactive-color "#505050" // active-gradient from="#ffbb66" to="#ffc880" angle=45 relative-to="workspace-view" - // inactive-gradient from="#505050" to="#808080" angle=45 relative-to="workspace-view" + // inactive-gradient from="#505050" to="#808080" angle=45 relative-to="workspace-view" in="srgb-linear" } } ``` @@ -238,6 +238,27 @@ layout { } ``` +<sup>Since: 0.1.8</sup> You can set the gradient interpolation color space using syntax like `in="srgb-linear"` or `in="oklch longer hue"`. +Supported color spaces are: + +- `srgb` (the default), +- `srgb-linear`, +- `oklab`, +- `oklch` with `shorter hue` or `longer hue` or `increasing hue` or `decreasing hue`. + +They are rendered the same as CSS. +For example, `active-gradient from="#f00f" to="#0f05" angle=45 in="oklch longer hue"` will look the same as CSS `linear-gradient(45deg in oklch longer hue, #f00f, #0f05)`. + + + +```kdl +layout { + border { + active-gradient from="#f00f" to="#0f05" angle=45 in="oklch longer hue" + } +} +``` + ### `struts` Struts shrink the area occupied by windows, similarly to layer-shell panels. |
