summaryrefslogtreecommitdiff
path: root/.local/bin/theme/gradient.py
blob: f95bb07605d19cecac228468e19089c6249011c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/python3
# Gets a color gradient based on input color and number
# Depends on python3-colour

import colour,sys

if len(sys.argv) != 4:
    print("arg error")
    sys.exit(1)

start = sys.argv[1]
end = sys.argv[2]
num = int(sys.argv[3])

grad = colour.color_scale(colour.hex2hsl(start),colour.hex2hsl(end),num)
grad_hex = []
for hsl in grad:
    grad_hex.append(colour.hsl2hex(hsl))

for color in grad_hex:
    sys.stdout.write(color + "\n")