Better opacity handling

This commit is contained in:
Filippo Berto 2021-06-29 11:05:55 +02:00
parent 30efa48b7d
commit 247185eafe
3 changed files with 15 additions and 16 deletions

View file

@ -21,7 +21,7 @@ in
(
final: prev: rec {
rice = prev.rice // {
colorPalette = with pkgs.rice; palette.palette {
colorPalette = with pkgs.rice; palette.palette rec {
black = color.hexToRgba nord.n0;
red = color.hexToRgba nord.n11;
green = color.hexToRgba nord.n14;
@ -34,11 +34,14 @@ in
bright-white = color.hexToRgba nord.n6;
bright-red = color.hexToRgba nord.n12;
cursor-cursor = color.hexToRgba nord.n4;
primary-background = color.tAlphaRgba (v: float.round (255 * opacity)) black;
};
font = {
normal = { package = pkgs.cantarell-fonts; name = "Cantarell"; };
monospace = { package = pkgs.nerdfonts; name = "FuraCode Nerd Font Mono"; };
};
opacity = 0.9;
};
}
)

View file

@ -1,4 +1,7 @@
{ pkgs, lib, ... }:
let
strPalette = with pkgs.rice; palette.toRgbHex colorPalette;
in
{
# Include fonts packages
home.packages = [ pkgs.rice.font.monospace.package ];
@ -11,34 +14,27 @@
normal.family = pkgs.rice.font.monospace.name;
size = 9.0;
};
background_opacity = 0.95;
background_opacity = pkgs.rice.opacity;
mouse = {
hide_when_typing = true;
hints.modifiers = "Control";
};
colors = with pkgs.rice; {
primary = palette.toRgbHex colorPalette.primary;
cursor = palette.toRgbHex colorPalette.cursor;
vi_mode_cursor = palette.toRgbHex colorPalette.vi_mode_cursor;
colors = with pkgs.rice; strPalette // {
selection = {
text = "CellForeground";
background = color.toRgbHex colorPalette.dim.blue;
background = strPalette.dim.blue;
};
search = {
matches = {
foreground = "CellForeground";
background = color.toRgbHex colorPalette.dim.cyan;
background = strPalette.dim.cyan;
};
bar = {
# foreground = "CellForeground";
background = color.toRgbHex colorPalette.dim.yellow;
foreground = strPalette.dim.cyan;
background = strPalette.dim.yellow;
};
};
normal = palette.toRgbHex colorPalette.normal;
bright = palette.toRgbHex colorPalette.bright;
dim = palette.toRgbHex colorPalette.dim;
};
};
};

View file

@ -13,8 +13,8 @@ let
colors = with pkgs.rice; palette.toARGBHex rec {
normal = {
foreground = colorPalette.normal.white;
background = color.tAlphaRgba (v: 240) colorPalette.normal.black;
foreground = colorPalette.primary.foreground;
background = colorPalette.primary.background;
underline = colorPalette.normal.blue;
};