Exemple #1
0
def randomColors(count: int) -> List[QColor]:
    colors = list()
    hue: int = random.randint(0, 359)
    for i in range(0, count):
        colors.append(QColor.fromHsl(hue, 255, 127))
        hue += random.randint(360 // (count * 2), 360 // count)
        hue = int(math.fmod(hue, 360))
    return colors
Exemple #2
0
 def obj(self):
     """Get Qt color object."""
     h, s, l, a = self._color
     return QColor.fromHsl(360 * h / 360, 255 * s / 100, 255 * l / 100,
                           255 * a)
Exemple #3
0
def angleSphToColor(phi, theta):
    return QColor.fromHsl(
        degrees(phi) % 360, 255, (degrees(pi - theta) % 181) * 255 / 180)