better color changing (maual)
This commit is contained in:
@@ -5,17 +5,18 @@
|
|||||||
<div class="color-container" style="border-color: ${color-set.base}">
|
<div class="color-container" style="border-color: ${color-set.base}">
|
||||||
<div class="color-box" style="background: ${color-set.dark}; height: ${builtins.toString size}px;">
|
<div class="color-box" style="background: ${color-set.dark}; height: ${builtins.toString size}px;">
|
||||||
<p style="color: ${color-set.bright}"> ${color-name}.dark </p>
|
<p style="color: ${color-set.bright}"> ${color-name}.dark </p>
|
||||||
|
<p style="color: ${color-set.bright}"> ${color-set.dark} </p>
|
||||||
</div>
|
</div>
|
||||||
<div class="color-box" style="background: ${color-set.base}; height: ${builtins.toString size}px;">
|
<div class="color-box" style="background: ${color-set.base}; height: ${builtins.toString size}px;">
|
||||||
<p class="dynamic-text"> ${color-name}.base </p>
|
<p class="dynamic-text"> ${color-name}.base </p>
|
||||||
|
<p class="dynamic-text"> ${color-set.base} </p>
|
||||||
</div>
|
</div>
|
||||||
<div class="color-box" style="background: ${color-set.bright}; height: ${builtins.toString size}px;">
|
<div class="color-box" style="background: ${color-set.bright}; height: ${builtins.toString size}px;">
|
||||||
<p style="color: ${color-set.dark}"> ${color-name}.bright </p>
|
<p style="color: ${color-set.dark}"> ${color-name}.bright </p>
|
||||||
|
<p style="color: ${color-set.dark}"> ${color-set.bright} </p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
||||||
in /* html */ ''
|
in /* html */ ''
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<head>
|
<head>
|
||||||
@@ -37,7 +38,7 @@
|
|||||||
color: ${foreground};
|
color: ${foreground};
|
||||||
width: fit-content;
|
width: fit-content;
|
||||||
margin: 10px auto 10px auto;
|
margin: 10px auto 10px auto;
|
||||||
background: ${background};
|
background: rgba(${rice.lib.hex-to-rgb-comma-string background},${builtins.toString rice.transparency});
|
||||||
border: ${builtins.toString rice.border-width}px solid ${border};
|
border: ${builtins.toString rice.border-width}px solid ${border};
|
||||||
border-radius: ${builtins.toString rice.rounding}px;
|
border-radius: ${builtins.toString rice.rounding}px;
|
||||||
padding: ${builtins.toString rice.gap-size}px;
|
padding: ${builtins.toString rice.gap-size}px;
|
||||||
@@ -66,18 +67,20 @@
|
|||||||
${cb accent "accent" 100}
|
${cb accent "accent" 100}
|
||||||
${cb secondary "secondary" 100}
|
${cb secondary "secondary" 100}
|
||||||
${cb tertiary "tertiary" 100}
|
${cb tertiary "tertiary" 100}
|
||||||
${cb weird "weird" 75}
|
${cb weird "weird" 100}
|
||||||
${cb special "special" 75}
|
${cb special "special" 100}
|
||||||
${cb positive "positive" 30}
|
<br>
|
||||||
${cb negative "negative" 30}
|
${cb positive "positive" 70}
|
||||||
${cb black "black" 25}
|
${cb negative "negative" 70}
|
||||||
${cb white "white" 25}
|
<br>
|
||||||
${cb blue "blue" 25}
|
${cb black "black" 50}
|
||||||
${cb cyan "cyan" 25}
|
${cb white "white" 50}
|
||||||
${cb green "green" 25}
|
${cb blue "blue" 50}
|
||||||
${cb magenta "magenta" 25}
|
${cb cyan "cyan" 50}
|
||||||
${cb red "red" 25}
|
${cb green "green" 50}
|
||||||
${cb yellow "yellow" 25}
|
${cb magenta "magenta" 50}
|
||||||
|
${cb red "red" 50}
|
||||||
|
${cb yellow "yellow" 50}
|
||||||
</body>
|
</body>
|
||||||
<script>
|
<script>
|
||||||
function getLuminance(color) {
|
function getLuminance(color) {
|
||||||
|
|||||||
@@ -339,7 +339,7 @@ in {
|
|||||||
"SUPER SHIFT, F5, exec, nx_gcal_event reauthenticate"
|
"SUPER SHIFT, F5, exec, nx_gcal_event reauthenticate"
|
||||||
"SUPER, F6, exec, kitty -e 'htop'"
|
"SUPER, F6, exec, kitty -e 'htop'"
|
||||||
"SUPER, F7, exec, kitty -e 'nmtui'"
|
"SUPER, F7, exec, kitty -e 'nmtui'"
|
||||||
''SUPER, F8, exec, find ~/Pictures/wallpapers/* -type f -not -path "~/Pictures/wallpapers/.git/*" | sort -R | head -n 1 | xargs swww img --transition-type wipe --transition-angle 60 --transition-step 120 --transition-fps 120''
|
''SUPER, F8, exec, find ~/Pictures/wallpapers/* -type f -not -path "~/Pictures/wallpapers/.git/*" | sort -R | head -n 1 | xargs -d '\n' swww img --transition-type wipe --transition-angle 60 --transition-step 120 --transition-fps 120 --transition-duration 2''
|
||||||
"SUPER, F9, execr, waybar_mode set ' '"
|
"SUPER, F9, execr, waybar_mode set ' '"
|
||||||
"SUPER, F9, submap, color"
|
"SUPER, F9, submap, color"
|
||||||
# "SUPER, F10, hyprload,update"
|
# "SUPER, F10, hyprload,update"
|
||||||
@@ -571,8 +571,8 @@ in {
|
|||||||
submap = reset
|
submap = reset
|
||||||
|
|
||||||
submap = color
|
submap = color
|
||||||
${action_simple { key = "W"; cmd = ''exec,kitty -e sh -c 'change_colors_json img $(swww query | sed -n 1p | sed -e "s-.*image: --g") && nh home switch' ''; }}
|
${action_simple { key = "W"; cmd = ''exec,swww query | sed -n 1p | sed -E 's-.*image: (.*)-"\1"-g' | xargs change_colors_json img && notify-send 'change_colors_json img successfull' ''; }}
|
||||||
${action_simple { key = "M"; cmd = ''exec,change_colors_json manual && kitty -e sh -c 'nh home switch && firefox /home/${user}/.config/color-pallete.html' ''; }}
|
${action_simple { key = "M"; cmd = ''exec,change_colors_json manual && notify-send 'change_colors_json manual successfull' ''; }}
|
||||||
${action_simple { key = "D"; cmd = ''exec,firefox /home/${user}/.config/color-pallete.html''; }}
|
${action_simple { key = "D"; cmd = ''exec,firefox /home/${user}/.config/color-pallete.html''; }}
|
||||||
bind = , Escape, execr, waybar_mode unset
|
bind = , Escape, execr, waybar_mode unset
|
||||||
bind = , Escape, submap, reset
|
bind = , Escape, submap, reset
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ from colorsys import hls_to_rgb, rgb_to_hls
|
|||||||
import json
|
import json
|
||||||
import sys
|
import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
|
from time import sleep
|
||||||
from typing import Literal, cast
|
from typing import Literal, cast
|
||||||
from numpy.typing import NDArray
|
from numpy.typing import NDArray
|
||||||
from sklearn.cluster import KMeans
|
from sklearn.cluster import KMeans
|
||||||
@@ -118,7 +119,7 @@ def extract_colors(
|
|||||||
return Palette(colors)
|
return Palette(colors)
|
||||||
|
|
||||||
def hyprpicker() -> Color:
|
def hyprpicker() -> Color:
|
||||||
ret = str(subprocess.run(["${pkgs.hyprpicker}/bin/hyprpicker", "-f", "rgb"], capture_output=True).stdout)[2:-3]
|
ret = str(subprocess.run(["${pkgs.hyprpicker}/bin/hyprpicker", "-n", "-f", "rgb"], capture_output=True).stdout)[2:-3]
|
||||||
return Color([int(c) for c in ret.split(" ")])
|
return Color([int(c) for c in ret.split(" ")])
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
@@ -130,7 +131,9 @@ if __name__ == "__main__":
|
|||||||
tertiary = ensure_color(c=palette[2], alter_sat=False)
|
tertiary = ensure_color(c=palette[2], alter_sat=False)
|
||||||
elif sys.argv[1] == "manual":
|
elif sys.argv[1] == "manual":
|
||||||
accent = ensure_color(c=hyprpicker(), alter_sat=False)
|
accent = ensure_color(c=hyprpicker(), alter_sat=False)
|
||||||
|
sleep(0.1)
|
||||||
secondary = ensure_color(c=hyprpicker(), alter_sat=True)
|
secondary = ensure_color(c=hyprpicker(), alter_sat=True)
|
||||||
|
sleep(0.1)
|
||||||
tertiary = ensure_color(c=hyprpicker(), alter_sat=False)
|
tertiary = ensure_color(c=hyprpicker(), alter_sat=False)
|
||||||
|
|
||||||
weird = alter_hue(ilist=accent, hue=80)
|
weird = alter_hue(ilist=accent, hue=80)
|
||||||
|
|||||||
Reference in New Issue
Block a user