]> Freerunner's - dabruin.kak/commitdiff
feat: revert nobold policy, dims are calculated on the fly
authorThomas Teixeira <thomas.teixeira@startmail.com>
Fri, 3 Nov 2023 11:18:29 +0000 (12:18 +0100)
committerThomas Teixeira <thomas.teixeira@startmail.com>
Fri, 3 Nov 2023 11:27:17 +0000 (12:27 +0100)
dabruin.kak

index 1dd54b259de8fa85159470664ab290e321a21ebc..767c6b3ce03c9e6bcc4a8526911ae7ce62b971aa 100644 (file)
@@ -4,43 +4,55 @@
 ##
 
 evaluate-commands %sh{
+    calculate_dim() {
+       printf "$1" | cut -d: -f2 | fold -b2 |
+               while read -r hex; do
+                       base10="$(printf '%d' "0x${hex}")"
+                       printf '%x' "$((base10 * 1 / 2))"
+               done | xargs printf 'rgb:%s'
+    }
+       # base
        accent="${kak_opt_dabruin_accent:-rgb:FFB852}"
        background='rgb:242124'
        foreground='rgb:F5F5F5'
        grey='rgb:B2BECA'
        deep='rgb:3D4C59'
+       # dim
+       accent_dim="$(calculate_dim "${accent}")"
+       foreground_dim="$(calculate_dim "${foreground}")"
+       grey_dim="$(calculate_dim "${grey}")"
        ## code
        cat     <<-COLORSCHEME
-               face global value ${foreground}+di
-               face global type ${foreground}+u
+               face global value ${foreground_dim}+i
+               face global type ${foreground}+bu
                face global variable ${foreground}+i
                face global module string
-               face global function ${accent}+di
+               face global function ${accent_dim}+i
                face global string ${grey}+i
-               face global keyword ${accent}
+               face global keyword ${accent_dim}
                face global operator ${foreground}
                face global attribute ${foreground}+i
                face global comment ${deep}
                face global documentation comment
-               face global meta ${accent}+d
+               face global meta ${accent_dim}+b
                face global builtin ${foreground}+i
 
-               face global title ${accent}+i
+               face global title ${accent}+bi
                face global header title
                face global mono string
                face global block mono
-               face global link ${accent}+ud
-               face global bullet ${foreground}+d
+               face global link ${accent_dim}+u
+               face global bullet ${foreground_dim}
                face global list bullet
 
                face global Default ${foreground},${background}
                face global PrimarySelection ${background},${accent}+fg
-               face global SecondarySelection ${accent},${background}+rdfg
+               face global SecondarySelection ${background},${accent_dim}+fg
                face global PrimaryCursor ${background},${foreground}+fg
-               face global SecondaryCursor ${foreground},${background}+rdfg
+               face global SecondaryCursor ${background},${foreground_dim}+fg
                face global PrimaryCursorEol ${grey}+r
-               face global SecondaryCursorEol ${grey}+dr
-               face global LineNumbers ${grey},${background}+d
+               face global SecondaryCursorEol ${grey_dim}+r
+               face global LineNumbers ${grey_dim},${background}
                face global LineNumbersWrapped ${background},${background}
                face global LineNumberCursor ${foreground},${background}
                face global MenuForeground ${accent},${background}+rb