as boasted in some other thread, i have put my CLI where my mouth is and have created palleter, a bash script to create a color pallete from a given image. right now, for testing purposes mostly, but also because, well, maybe you want it, it will change your console theme with it immediately as well. of course there is the much superior
Console Theme Switcher to switch your console themes with a collection of stuff, and maybe there is some way to integrate this tool with that mother.
here's the script:
Code: Select all
#!/bin/bash
# takes an image and creates a color palette from it
# which gets echoed to the console.
#
# made by rhowaldt (fuck you)
#
# depends: imagemagick
PALETTE=$(convert "$1" -colors 16 -format "%c" histogram:info:)
HEXLIST=$(echo "$PALETTE" | sed 's/^.*\#\(.*\) srgb.*/\1/g')
COL=("0" "8" "1" "9" "2" "A" "3" "B" "4" "C" "5" "D" "6" "E" "7" "F");
x=0
while read line; do
echo -en "\e]P${COL[$x]}$line";
let x=x+1
done <<< "$HEXLIST"
clear
here's the image i used for testing:
- tigermonk
here's the resulting scheme:
- nice 'n pink
- tigermonk.png (10.83 KiB) Viewed 9320 times
(possible) issues: i am new to all this, and i did not take care to make sure a color resembling white is actually being used for the 'white' console color. in order to do something like this there would have to be a hex-color-check in the script that determines how close a certain color is to one of the designated ones. i do not know if this matters at all. please let me know :)