hsla color

This commit is contained in:
Frank DeMarco 2015-09-16 12:22:03 -04:00
parent 97425e702b
commit 4ed3f9cec7
1 changed files with 6 additions and 1 deletions

View File

@ -1,7 +1,7 @@
from random import randint
from math import sin, cos, atan2, radians, sqrt
from pygame import Surface, PixelArray
from pygame import Surface, PixelArray, Color
from pygame.mixer import get_num_channels, Channel
from pygame.locals import *
@ -177,3 +177,8 @@ def get_shadowed_text(text, font, offset, color, antialias=True, shadow_color=(0
surface.blit(foreground, ((abs(offset[0]) - offset[0]) / 2,
(abs(offset[1]) - offset[1]) / 2))
return surface
def get_hsla_color(hue, saturation=100, lightness=50, alpha=100):
color = Color(0, 0, 0, 0)
color.hsla = hue, saturation, lightness, alpha
return color