def GetRandomColor(): if not getattr(ColorManager.GetRandomColor, 'currentHue', None): ColorManager.GetRandomColor.currentHue = random.random() color = QColor.fromHslF(ColorManager.GetRandomColor.currentHue, 1.0, 0.5) ColorManager.GetRandomColor.currentHue = ColorManager.GetRandomColor.currentHue + 0.618033988749895 ColorManager.GetRandomColor.currentHue = math.fmod( ColorManager.GetRandomColor.currentHue, 1.0) return color
def setUp(self): self.original = QColor.fromHslF(0.2, 0.3, 0.4, 0.5)
def testReduceHsl(self): self.reduceColor(QColor.fromHslF(0.1, 0.2, 0.3, 0.4))