A fork of the Materia GTK theme.

Important information: Google announced that, from September 2026, Android devices will require ALL apps to be signed by Google, effectively leading to an iOS situation. Value your right to a computer that does what you want; do not tolerate this monopolistic practice! Contact me if you don't understand why it is bad. Click to learn more.

 darker.sh

View raw Download
text/x-shellscript • 624 B
Bourne-Again shell script, ASCII text executable
        
            
1
#!/usr/bin/env bash
2
#set -x
3
4
darker_channel() {
5
value=${1}
6
light_delta=${2}
7
result=$(echo "ibase=16; ${value} - ${light_delta}" | bc)
8
if [[ ${result} -lt 0 ]] ; then
9
result=0
10
fi
11
if [[ ${result} -gt 255 ]] ; then
12
result=255
13
fi
14
echo "${result}"
15
}
16
17
18
darker() {
19
hexinput=$(echo $1 | tr '[:lower:]' '[:upper:]')
20
light_delta=${2-10}
21
22
a=`echo $hexinput | cut -c-2`
23
b=`echo $hexinput | cut -c3-4`
24
c=`echo $hexinput | cut -c5-6`
25
26
r=$(darker_channel ${a} ${light_delta})
27
g=$(darker_channel ${b} ${light_delta})
28
b=$(darker_channel ${c} ${light_delta})
29
30
printf '%02x%02x%02x\n' ${r} ${g} ${b}
31
}
32
33
darker $@
34