Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduce alpha value of patch background colors (#159)
Adjusted the background colors for patches by reducing their alpha value by 80%. The resulting RGBA color was converted precisely into the respective RGB color (HEX format) since JetBrains rendering engine still has problems when using the 8-digit HEX format that includes the value for the alpha layer. The values have been calculated to get exact and predictable colors, at least for usage in other ports if required as well as in languages like CSS. Sass [1] comes with the color module that provides the scale function [2] that allows to "fluidly scale one or more properties of a color" like e.g. alpha or saturation: ```scss @use "sass:color"; $nord0: #2e3440; $nord9: #81a1c1; $nord11: #bf616a; $nord13: #ebcb8b; @function rgba-to-rgb($rgba, $background: $nord0) { @return mix( rgb(red($rgba), green($rgba), blue($rgba)), $background, alpha($rgba) * 100% ); } :root { --diff-added-reduced-alpha: #{rgba-to-rgb(color.scale($nord9, $alpha: -80%))}; --diff-deleted-reduced-alpha: #{rgba-to-rgb(color.scale($nord11, $alpha: -80%))}; --diff-modified-reduced-alpha: #{rgba-to-rgb(color.scale($nord13, $alpha: -80%))}; } ``` Compiling the Sass code above using the official Dart reference implementation [3] via the CLI resulted in the following colors: ```css :root { --diff-added-reduced-alpha: #3f4a5a; --diff-deleted-reduced-alpha: #4b3d48; --diff-modified-reduced-alpha: #54524f; } ``` [1]: https://sass-lang.com [2]: https://sass-lang.com/documentation/modules/color#scale [3]: https://github.com/sass/dart-sass GH-159 Co-authored-by: Arctic Ice Studio <[email protected]> Co-authored-by: Sven Greb <[email protected]>
- Loading branch information