mirror of
https://github.com/RGBCube/ThemeNix
synced 2025-07-28 00:47:44 +00:00
Make visualize script better
This commit is contained in:
parent
f52e118155
commit
74a0f09d71
1 changed files with 3 additions and 10 deletions
13
visualize.nu
13
visualize.nu
|
@ -15,18 +15,11 @@ def main [
|
||||||
|
|
||||||
$theme
|
$theme
|
||||||
| reject name author
|
| reject name author
|
||||||
| transpose name value
|
| transpose key value
|
||||||
| each { |it|
|
| each { |it|
|
||||||
let hex = ("0x" + $in.value) | into int
|
let color = { bg: ("#" + $it.value) }
|
||||||
|
|
||||||
let r = $hex bit-shr 16
|
echo $"($it.key): (ansi $color) (ansi reset)"
|
||||||
let g = $hex bit-shr 8 bit-and 0xFF
|
|
||||||
let b = $hex bit-and 0xFF
|
|
||||||
|
|
||||||
$it | merge { value: $"\\033[48;2;($r);($g);($b)m" }
|
|
||||||
}
|
|
||||||
| each { |it|
|
|
||||||
^echo -e $"($it.name): ($it.value) \\033[0m"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$"\n($theme.name) by ($theme.author)"
|
$"\n($theme.name) by ($theme.author)"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue