本文整理汇总了Python中AppKit.NSColor.colorWithCalibratedHue_saturation_brightness_alpha_方法的典型用法代码示例。如果您正苦于以下问题:Python NSColor.colorWithCalibratedHue_saturation_brightness_alpha_方法的具体用法?Python NSColor.colorWithCalibratedHue_saturation_brightness_alpha_怎么用?Python NSColor.colorWithCalibratedHue_saturation_brightness_alpha_使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AppKit.NSColor
的用法示例。
在下文中一共展示了NSColor.colorWithCalibratedHue_saturation_brightness_alpha_方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: newObject
# 需要导入模块: from AppKit import NSColor [as 别名]
# 或者: from AppKit.NSColor import colorWithCalibratedHue_saturation_brightness_alpha_ [as 别名]
def newObject(self):
"Randomize attributes of new circles so we get a pretty display"
self.newCircle = super(GraphicsArrayController, self).newObject()
radius = 5.0 + 15.0 * random()
self.newCircle.radius = radius
height = self.graphicsView.bounds().size.height
width = self.graphicsView.bounds().size.width
xOffset = 10.0 + (height - 20.0) * random()
yOffset = 10.0 + (width - 20.0) * random()
self.newCircle.xLoc = xOffset
self.newCircle.yLoc = height - yOffset
color = NSColor.colorWithCalibratedHue_saturation_brightness_alpha_(
random(),
(0.5 + random() / 2.0),
(0.333 + random() / 3.0),
1.0)
self.newCircle.color = color
return self.newCircle