get lightened color

This commit is contained in:
Frank DeMarco 2019-12-12 17:32:34 -05:00
parent 1f01be3882
commit 07d404e64b
1 changed files with 5 additions and 1 deletions

View File

@ -85,7 +85,7 @@ def get_range_steps(start, end, count):
def get_percent_way(iterable):
for ii in range(len(iterable)):
yield iterable[ii], float(ii) / len(iterable)
yield iterable[ii], float(ii) / (len(iterable) - 1)
def mirrored(iterable, full=False, tail=True):
for ii, item in enumerate(itertools.chain(iterable, reversed(iterable))):
@ -329,6 +329,10 @@ def get_hsva_color(hue, saturation=100, value=100, alpha=100):
color.hsva = hue % 360, saturation, value, alpha
return color
def get_lightened_color(color, lightness):
h, s, _, a = color.hsla
return get_hsla_color(h, s, lightness, a)
# http://www.pygame.org/wiki/BezierCurve
def compute_bezier_points(vertices, numPoints=60):
points = []