mirror of
https://github.com/b-ryan/powerline-shell.git
synced 2026-09-10 07:26:28 -04:00
Fixing indent
This commit is contained in:
parent
0bca50bb18
commit
81653f4c0c
|
|
@ -10,21 +10,21 @@ from .utils import py3
|
|||
|
||||
|
||||
def getOppositeColor(r,g,b):
|
||||
r, g, b = [x/255.0 for x in r, g, b] # convert to float before getting hls value
|
||||
hls = rgb_to_hls(r,g,b)
|
||||
opp = list(hls[:])
|
||||
opp[0] = (opp[0]+0.2)%1 # shift hue (a.k.a. color)
|
||||
if opp[1] > 255/2: # for level you want to make sure they
|
||||
opp[1] -= 255/2 # are quite different so easily readable
|
||||
else:
|
||||
opp[1] += 255/2
|
||||
if opp[2] > -0.5: # if saturation is low on first color increase second's
|
||||
opp[2] -= 0.5
|
||||
opp = hls_to_rgb(*opp)
|
||||
m = max(opp)
|
||||
if m > 255: #colorsys module doesn't give caps to their conversions
|
||||
opp = [ x*254/m for x in opp]
|
||||
return tuple([ int(x) for x in opp])
|
||||
r, g, b = [x/255.0 for x in r, g, b] # convert to float before getting hls value
|
||||
hls = rgb_to_hls(r,g,b)
|
||||
opp = list(hls[:])
|
||||
opp[0] = (opp[0]+0.2)%1 # shift hue (a.k.a. color)
|
||||
if opp[1] > 255/2: # for level you want to make sure they
|
||||
opp[1] -= 255/2 # are quite different so easily readable
|
||||
else:
|
||||
opp[1] += 255/2
|
||||
if opp[2] > -0.5: # if saturation is low on first color increase second's
|
||||
opp[2] -= 0.5
|
||||
opp = hls_to_rgb(*opp)
|
||||
m = max(opp)
|
||||
if m > 255: #colorsys module doesn't give caps to their conversions
|
||||
opp = [ x*254/m for x in opp]
|
||||
return tuple([ int(x) for x in opp])
|
||||
|
||||
def stringToHashToColorAndOpposite(string):
|
||||
if py3:
|
||||
|
|
|
|||
Loading…
Reference in a new issue