From ab3ce3c7c545a884db77c0a9a6475546f02b6ad2 Mon Sep 17 00:00:00 2001 From: Addison Beck Date: Sat, 16 Nov 2024 13:13:03 -0500 Subject: [PATCH] Playing with colors --- config/colors.nix | 171 +++++++++++++++--- flake.nix | 11 +- .../with/program/neovim/colors/default.nix | 126 +++++-------- .../with/user/with/program/neovim/default.nix | 6 +- system/with/user/with/program/stylix.nix | 11 +- 5 files changed, 201 insertions(+), 124 deletions(-) diff --git a/config/colors.nix b/config/colors.nix index f90828d..a4b2d2e 100644 --- a/config/colors.nix +++ b/config/colors.nix @@ -1,31 +1,146 @@ -{ - spongebob = { - dark = { - base00 = "#110f15"; # ---- Default Background: Rock bottom night 0 - base01 = "#050a1b"; # - Lighter Background: Bikini bottom night 0 - base02 = "#0b0747"; # --- Selection Background: Bikini bottom night 1 - base03 = "#2d9db8"; # -- Comments, Invisibles, Line Highlighting: Bikini bottom night 2 - base04 = "#254657"; # + Dark Foreground: Goo lagoon - base05 = "#D8E4B9"; # ++ Default Foreground: Bikini bottom sand - base06 = "#3A662F"; # +++ Light Foreground: Krusty Krab Floor - base07 = "#637bc8"; # ++++ Light Background: Chum bucket glove - base08 = "#FF3B3F"; # Red: Krabs / Larry / Barnacle Boy / Man Ray - base09 = "#fbac12"; # mermaid man orange - base0A = "#F9E500"; # Spongebob yellow - base0B = "#3A662F"; # plankton green - base0C = "#77BCDD"; # gary blue - base0D = "#00A9E0"; # sea blue - base0E = "#D06D98"; # jellyfish purple - base0F = "#9E7A38"; # Spongebob's shorts brown - - # base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted - # base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url - # base0A - Classes, Markup Bold, Search Text Background - # base0B - Strings, Inherited Class, Markup Code, Diff Inserted - # base0C - Support, Regular Expressions, Escape Characters, Markup Quotes - # base0D - Functions, Methods, Attribute IDs, Headings - # base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed - # base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. +{ ... }: let + colors = { + spongebob = { + rockBottomNight0 = "#110f15"; + bikiniBottomNight0 = "#050a1b"; + bikiniBottomNight1 = "#050a1b"; + bikiniBottomNight2 = "#2d9db8"; + gooLagoon = "#254657"; + bikiniBottomSand = "D8E4B9"; + krustyKrabFloor = "#3A662F"; + chumBucketGlove = "#637bc8"; + mrKrabsRed = "#FF3B3f"; + mermaidManOrange = "#FBAC12"; + spongebobYellow = "#F9E500"; + planktonGreen = "#3A662F"; + garyBlue = "#77BCDD"; + bikiniBottomDay0 = "#00A9E0"; + jellyfishPurple = "#D06D98"; + spongebobsPantsBrown = "#9E7A38"; + }; + gruvbox = { + hard = { + dark = { + bg1 = "#1d2021"; # ---- + bg2 = "#3c3836"; # --- + bg3 = "#504945"; # -- + bg4 = "#665c54"; # - + fg1 = "#bdae93"; # + + fg2 = "#d5c4a1"; # ++ + fg3 = "#ebdbb2"; # +++ + fg4 = "#fbf1c7"; # ++++ + red = "#fb4934"; + orange = "#fe8019"; + yellow = "#fabd2f"; + green = "#b8bb26"; + aqua = "#8ec07c"; + blue = "#83a598"; + purple = "#d3869b"; + brown = "#d65d0e"; + }; + light = { + bg1 = "#f9f5d7"; + bg2 = "#ebdbb2"; + bg3 = "#d5c4a1"; + bg4 = "#bdae93"; + fg1 = "#665c54"; + fg2 = "#504945"; + fg3 = "#3c3836"; + fg4 = "#282828"; + red = "#9d0006"; + orange = "#af3a03"; + yellow = "#b57614"; + green = "#79740e"; + aqua = "#427b58"; + blue = "#076678"; + purple = "#8f3f71"; + brown = "#d65d0e"; + }; + }; + }; + }; + /** + The base16 color scheme schema looks like this: + ``` + base00 = ""; # Default Background + base01 = ""; # Lighter Background + base02 = ""; # Selection Background + base03 = ""; # Comments, Invisibles, Line Highlighting + base04 = ""; # Dark Foreground + base05 = ""; # Default Foreground + base06 = ""; # Light Foreground + base07 = ""; # Light Background + base08 = ""; # Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted + base09 = ""; # Integers, Boolean, Constants, XML Attributes, Markup Link URL + base0A = ""; # Classes, Markup Bold, Search Text Background + base0B = ""; # Strings, Inherited Class, Markup Code, Diff Inserted + base0C = ""; # Support, Regular Expressions, Escape Characters, Markup Quotes + base0D = ""; # Function, Methods, Attribute IDs, Headings + base0E = ""; # Keywords, Storage, Selector, Markup Italic, Diff Changed + base0F = ""; # Deprecated, Opening/Closing Embedded Language Tags, eg + ``` + */ + themes = { + spongebob = { + dark = { + base00 = colors.spongebob.rockBottomNight0; + base01 = colors.spongebob.bikiniBottomNight0; + base02 = colors.spongebob.bikiniBottomNight1; + base03 = colors.spongebob.bikiniBottomNight2; + base04 = colors.spongebob.gooLagoon; + base05 = colors.spongebob.bikiniBottomSand; + base06 = colors.spongebob.kurstyKrabFloor; + base07 = colors.spongebob.chumBucketGlove; + base08 = colors.spongebob.mrKrabsRed; + base09 = colors.spongebob.mermaidManOrange; + base0A = colors.spongebob.spongebobYellow; + base0B = colors.spongebob.planktonGreen; + base0C = colors.spongebob.garyBlue; + base0D = colors.spongebob.bikiniBottomDay0; + base0E = colors.spongebob.jellyfishPurple; + base0F = colors.spongebob.spongebobsPantsBrown; + }; + }; + gruvbox = { + dark = { + base00 = colors.gruvbox.hard.dark.bg1; + base01 = colors.gruvbox.hard.dark.bg2; + base02 = colors.gruvbox.hard.dark.bg3; + base03 = colors.gruvbox.hard.dark.bg4; + base04 = colors.gruvbox.hard.dark.fg1; + base05 = colors.gruvbox.hard.dark.fg2; + base06 = colors.gruvbox.hard.dark.fg3; + base07 = colors.gruvbox.hard.dark.fg4; + base08 = colors.gruvbox.hard.dark.red; + base09 = colors.gruvbox.hard.dark.orange; + base0A = colors.gruvbox.hard.dark.yellow; + base0B = colors.gruvbox.hard.dark.green; + base0C = colors.gruvbox.hard.dark.aqua; + base0D = colors.gruvbox.hard.dark.blue; + base0E = colors.gruvbox.hard.dark.purple; + base0F = colors.gruvbox.hard.dark.brown; + }; + light = { + base00 = colors.gruvbox.hard-light.bg1; + base01 = colors.gruvbox.hard.light.bg2; + base02 = colors.gruvbox.hard.light.bg3; + base03 = colors.gruvbox.hard.light.bg4; + base04 = colors.gruvbox.hard.light.fg1; + base05 = colors.gruvbox.hard.light.fg2; + base06 = colors.gruvbox.hard.light.fg3; + base07 = colors.gruvbox.hard.light.fg4; + base08 = colors.gruvbox.hard.light.red; + base09 = colors.gruvbox.hard.light.orange; + base0A = colors.gruvbox.hard.light.yellow; + base0B = colors.gruvbox.hard.light.green; + base0C = colors.gruvbox.hard.light.aqua; + base0D = colors.gruvbox.hard.light.blue; + base0E = colors.gruvbox.hard.light.purple; + base0F = colors.gruvbox.hard.light.brown; + }; }; }; +in { + colors = colors; + themes = themes; } diff --git a/flake.nix b/flake.nix index 096baab..6eea399 100644 --- a/flake.nix +++ b/flake.nix @@ -48,15 +48,14 @@ forAllSystemTypes = fn: nixpkgs.lib.genAttrs supportedSystems fn; systemTheme = import ./config/system-theme.nix; colorscheme = import ./config/colorscheme.nix; - colors = import ./config/colors.nix; + colors = import ./config/colors.nix {}; rootPath = ./.; in { nixosConfigurations = { minecraft = inputs.nixpkgs.lib.nixosSystem { system = "x86_64-linux"; specialArgs = { - inherit inputs outputs nixpkgs rootPath systemTheme colorscheme - colors; + inherit inputs outputs nixpkgs rootPath systemTheme colorscheme colors; pkgs-forked = import inputs.nixpkgs-forked { system = "x86_64-linux"; config.allowUnfree = true; @@ -69,8 +68,7 @@ bw = nix-darwin.lib.darwinSystem { system = "aarch64-darwin"; specialArgs = { - inherit inputs outputs nixpkgs rootPath systemTheme colorscheme - colors; + inherit inputs outputs nixpkgs rootPath systemTheme colorscheme colors; hostname = "bw"; pkgs-forked = import inputs.nixpkgs-forked { system = "aarch64-darwin"; @@ -89,8 +87,7 @@ air = nix-darwin.lib.darwinSystem { system = "aarch64-darwin"; specialArgs = { - inherit inputs outputs nixpkgs rootPath systemTheme colorscheme - colors; + inherit inputs outputs nixpkgs rootPath systemTheme colorscheme colors; hostname = "air"; pkgs-forked = import inputs.nixpkgs-forked { system = "aarch64-darwin"; diff --git a/system/with/user/with/program/neovim/colors/default.nix b/system/with/user/with/program/neovim/colors/default.nix index b8aef79..72b8aaf 100644 --- a/system/with/user/with/program/neovim/colors/default.nix +++ b/system/with/user/with/program/neovim/colors/default.nix @@ -1,108 +1,80 @@ { systemTheme, colorscheme, + colors, ... -}: let - markdownInlineCode = { - dark = { - bg = "#282828"; - fg = "#d3869b"; # orange - }; - light = { - bg = "#d5c4a1"; - fg = "#af3a03"; # orange - }; - }; - markdownQuotes = { - dark = { - bg = "#3c3836"; - fg = "#fe8019"; # purple - }; - light = { - bg = "#ebdbb2"; - fg = "#8f3f71"; # purple - }; - }; -in { +}: { options = { background = "${systemTheme}"; termguicolors = false; }; - highlightOverrides = { - SatelliteBackground.link = "SignColumn"; - SatelliteBar.link = "VisualMode"; - MatchParen.link = "Cursor"; - ActiveYank = { - # "Incandescent Light Bulb - bg = "#FFBB73"; - fg = "#000000"; - }; - SignColumn = { - bg = "none"; - ctermbg = "none"; - }; - Nontext = { - link = "Normal"; - }; - "@function" = { - italic = false; - }; - "@function.builtin" = { - italic = false; - }; - "@markup.list.checked.markdown" = { - italic = true; - fg = "#b8bb26"; - }; - }; colorscheme = { gruvbox = { enable = colorscheme == "gruvbox"; settings = { transparent_mode = true; overrides = { + SatelliteBackground.link = "SignColumn"; + SatelliteBar.link = "VisualMode"; + MatchParen.link = "Cursor"; + ActiveYank = { + # "Incandescent Light Bulb + bg = "#FFBB73"; + fg = "#000000"; + }; + SignColumn = { + bg = "none"; + ctermbg = "none"; + }; + Nontext = { + link = "Normal"; + }; + "@function" = { + italic = false; + }; + "@function.builtin" = { + italic = false; + }; + "@markup.list.checked.markdown" = { + italic = true; + fg = "#b8bb26"; + }; Comment = { bold = false; italic = true; }; Winbar = { bold = true; - fg = 4; + #fg = 4; bg = "NONE"; }; WinbarNC = { bold = true; - fg = 8; + #fg = 8; bg = "NONE"; }; - "@markup.raw.markdown_inline" = { - bg = markdownInlineCode.${systemTheme}.bg; - fg = markdownInlineCode.${systemTheme}.fg; - italic = false; - bold = true; - }; - "@markup.link.label.markdown_inline" = { - link = "GruvboxBlue"; - }; - "@markup.quote.markdown" = { - italic = true; - bold = false; - bg = markdownQuotes.${systemTheme}.bg; - fg = markdownQuotes.${systemTheme}.fg; - }; - "@markup.heading" = { - underdotted = true; - bold = true; - italic = true; - }; + # "@markup.raw.markdown_inline" = { + # bg = colors.themes.${colorscheme}.${systemTheme}.base01; + # fg = colors.themes.${colorscheme}.${systemTheme}.base09; + # italic = false; + # bold = true; + # }; + # "@markup.link.label.markdown_inline" = { + # link = colors.themes.${colorscheme}.${systemTheme}.base0D; + # }; + # "@markup.quote.markdown" = { + # italic = true; + # bold = false; + # bg = colors.themes.${colorscheme}.${systemTheme}.base02; + # fg = colors.themes.${colorscheme}.${systemTheme}.base0E; + # }; + # "@markup.heading" = { + # underdotted = true; + # bold = true; + # italic = true; + # }; }; }; }; - nord = { - enable = colorscheme == "nord"; - settings = { - disable_background = true; - }; - }; }; } diff --git a/system/with/user/with/program/neovim/default.nix b/system/with/user/with/program/neovim/default.nix index c7adc81..f9be620 100644 --- a/system/with/user/with/program/neovim/default.nix +++ b/system/with/user/with/program/neovim/default.nix @@ -5,6 +5,7 @@ inputs, systemTheme, colorscheme, + colors, ... }: let options = @@ -12,15 +13,14 @@ import ./options {} ) // ( - (import ./colors {inherit systemTheme colorscheme;}).options + (import ./colors {inherit systemTheme colorscheme colors;}).options ); in { programs.nixvim = { enable = true; vimAlias = true; opts = options; - colorschemes = (import ./colors {inherit systemTheme colorscheme;}).colorscheme; - highlightOverride = (import ./colors {inherit systemTheme colorscheme;}).highlightOverrides; + colorschemes = (import ./colors {inherit systemTheme colorscheme colors;}).colorscheme; plugins = (import ./plugins {inherit inputs pkgs;}).plugins; extraPlugins = (import ./plugins {inherit inputs pkgs;}).extraPlugins; autoCmd = (import ./auto-commands {}).autoCommands; diff --git a/system/with/user/with/program/stylix.nix b/system/with/user/with/program/stylix.nix index d468740..eccb8b1 100644 --- a/system/with/user/with/program/stylix.nix +++ b/system/with/user/with/program/stylix.nix @@ -2,19 +2,12 @@ pkgs, systemTheme, colorscheme, + colors, ... }: { stylix.enable = true; stylix.image = ../wallpaper/empty.png; - stylix.base16Scheme = - if colorscheme == "nord" - then - if systemTheme == "light" - then "${pkgs.base16-schemes}/share/themes/nord-light.yaml" - else "${pkgs.base16-schemes}/share/themes/nord.yaml" - else - # Default to gruvbox - "${pkgs.base16-schemes}/share/themes/gruvbox-${systemTheme}-hard.yaml"; + stylix.base16Scheme = colors.themes."${colorscheme}"."${systemTheme}"; stylix.fonts = { serif = {