当前位置: 首页>>代码示例>>Python>>正文


Python NSColor.colorWithDeviceRed_green_blue_alpha_方法代码示例

本文整理汇总了Python中AppKit.NSColor.colorWithDeviceRed_green_blue_alpha_方法的典型用法代码示例。如果您正苦于以下问题:Python NSColor.colorWithDeviceRed_green_blue_alpha_方法的具体用法?Python NSColor.colorWithDeviceRed_green_blue_alpha_怎么用?Python NSColor.colorWithDeviceRed_green_blue_alpha_使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AppKit.NSColor的用法示例。


在下文中一共展示了NSColor.colorWithDeviceRed_green_blue_alpha_方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: drawRect_

# 需要导入模块: from AppKit import NSColor [as 别名]
# 或者: from AppKit.NSColor import colorWithDeviceRed_green_blue_alpha_ [as 别名]
 def drawRect_(self, rect):
     if self.inLiveResize():
         self._recalcSize()
     from random import random
     NSColor.redColor().set()
     NSRectFill(self.bounds())
     width, height = self.frame()[1]
     w = width / 5
     h = height / 5
     for xI in range(5):
         for yI in range(5):
             x = xI * w
             y = height - (yI * h) - h
             r = ((x, y), (w, h))
             NSColor.colorWithDeviceRed_green_blue_alpha_(random(), random(), random(), 1.0).set()
             NSRectFill(r)
开发者ID:typesupply,项目名称:vanilla,代码行数:18,代码来源:testAll.py

示例2: stroke

# 需要导入模块: from AppKit import NSColor [as 别名]
# 或者: from AppKit.NSColor import colorWithDeviceRed_green_blue_alpha_ [as 别名]
def stroke(r=None, g=None, b=None, a=1):
	# Set the stroke color as RGB value.
	global currentStrokeColor
	if r is None:
		currentStrokeColor = None
	elif g is None:
		currentStrokeColor = NSColor.colorWithDeviceWhite_alpha_(r, a)
	else:
		currentStrokeColor = NSColor.colorWithDeviceRed_green_blue_alpha_(r, g, b, a)
开发者ID:pobivan,项目名称:GlyphsSDK,代码行数:11,代码来源:drawingTools.py

示例3: fill

# 需要导入模块: from AppKit import NSColor [as 别名]
# 或者: from AppKit.NSColor import colorWithDeviceRed_green_blue_alpha_ [as 别名]
def fill(r=None, g=None, b=None, a=1):
	# Set the fill color as RGB value.
	global currentFillColor
	global currentGradient
	if r is None:
		currentFillColor = None
	elif g is None:
		currentFillColor = NSColor.colorWithDeviceWhite_alpha_(r, a)
		currentGradient = None
	else:
		currentFillColor = NSColor.colorWithDeviceRed_green_blue_alpha_(r, g, b, a)
		currentGradient = None
开发者ID:pobivan,项目名称:GlyphsSDK,代码行数:14,代码来源:drawingTools.py

示例4: setBackgroundColor

# 需要导入模块: from AppKit import NSColor [as 别名]
# 或者: from AppKit.NSColor import colorWithDeviceRed_green_blue_alpha_ [as 别名]
 def setBackgroundColor(self, color):
     r, g, b, a = color
     self.backgroundColor = color
     self.w.backgroundColorWell.set(NSColor.colorWithDeviceRed_green_blue_alpha_(r, g, b, a))
开发者ID:gr91,项目名称:responsiveLettering,代码行数:6,代码来源:cmd_exportCurrentFont.py

示例5: setShapeColor

# 需要导入模块: from AppKit import NSColor [as 别名]
# 或者: from AppKit.NSColor import colorWithDeviceRed_green_blue_alpha_ [as 别名]
 def setShapeColor(self, color):
     r, g, b, a = color
     self.shapeColor = color
     self.w.shapeColorWell.set(NSColor.colorWithDeviceRed_green_blue_alpha_(r, g, b, a))
开发者ID:gr91,项目名称:responsiveLettering,代码行数:6,代码来源:cmd_exportCurrentFont.py


注:本文中的AppKit.NSColor.colorWithDeviceRed_green_blue_alpha_方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。