本文整理汇总了Python中AppKit.NSColor.blueColor方法的典型用法代码示例。如果您正苦于以下问题:Python NSColor.blueColor方法的具体用法?Python NSColor.blueColor怎么用?Python NSColor.blueColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AppKit.NSColor
的用法示例。
在下文中一共展示了NSColor.blueColor方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: applicationDidFinishLaunching_
# 需要导入模块: from AppKit import NSColor [as 别名]
# 或者: from AppKit.NSColor import blueColor [as 别名]
def applicationDidFinishLaunching_(self, aNotification):
d = {'StderrColor': NSArchiver.archivedDataWithRootObject_(NSColor.redColor()),
'StdoutColor': NSArchiver.archivedDataWithRootObject_(NSColor.blueColor()),
'CodeColor': NSArchiver.archivedDataWithRootObject_(NSColor.blackColor()),
}
defaults = NSUserDefaults.standardUserDefaults()
defaults.registerDefaults_(d)
self.textView.setFont_(self.font())
self._stderrColor = NSUnarchiver.unarchiveObjectWithData_(defaults['StderrColor'])
self._stdoutColor = NSUnarchiver.unarchiveObjectWithData_(defaults['StdoutColor'])
self._codeColor = NSUnarchiver.unarchiveObjectWithData_(defaults['CodeColor'])
self._executeWithRedirectedIO_args_kwds_(self._interp, (), {})
示例2: draw
# 需要导入模块: from AppKit import NSColor [as 别名]
# 或者: from AppKit.NSColor import blueColor [as 别名]
def draw(self, scale):
# drawBackground(self
if not hasattr(self, "prefs"):
return
s = self.prefs['toolDiameter'] # / scale
last = None
if not self.pts: return
if self.prefs['drawTail']:
drawThese = self.pts[:]
else:
drawThese = [self.pts[-1]]
stroke(None)
for (x,y), level, tdm in drawThese:
key = (x,y),tdm
if self.prefs['invert']:
fill(1-level)
else:
fill(level)
stroke(None)
if self.prefs['toolStyle'] == "grid":
rect(x-.5*tdm, y-0.5*tdm, tdm, tdm)
else:
oval(x-.5*tdm, y-0.5*tdm, tdm, tdm)
if round(level, 3) == 0:
stroke(None)
fill(1)
oval(x-.5*self.fullColorMarkerSize, y-.5*self.fullColorMarkerSize, self.fullColorMarkerSize, self.fullColorMarkerSize)
elif round(level,3) == 1.0:
stroke(None)
fill(0)
oval(x-.5*self.fullColorMarkerSize, y-.5*self.fullColorMarkerSize, self.fullColorMarkerSize, self.fullColorMarkerSize)
self.drawDiameter(x, y, scale, showSize=self.isResizing)
(x,y), level, tdm = drawThese[-1]
if self.prefs['invert']:
fill(1-level)
else:
fill(level)
stroke(None)
if self.prefs['toolStyle'] == "grid":
rect(x-.5*tdm, y-0.5*tdm, tdm, tdm)
else:
oval(x-.5*tdm, y-0.5*tdm, tdm, tdm)
tp, level, tdm = self.pts[-1]
self.getNSView()._drawTextAtPoint(
"%3.2f"%(100-100*level),
self.textAttributes,
tp,
yOffset=-30,
drawBackground=True,
backgroundColor=NSColor.blueColor())
示例3: transformedValue_
# 需要导入模块: from AppKit import NSColor [as 别名]
# 或者: from AppKit.NSColor import blueColor [as 别名]
def transformedValue_(self, priority):
if priority > 4:
return NSColor.redColor()
elif priority > 3:
return NSColor.orangeColor()
elif priority > 2:
return NSColor.blueColor()
elif priority > 1:
return NSColor.greenColor()
elif priority > 0:
return NSColor.brownColor()
else:
return NSColor.blackColor()
示例4: __init__
# 需要导入模块: from AppKit import NSColor [as 别名]
# 或者: from AppKit.NSColor import blueColor [as 别名]
""" A class representing dimensions in pixel of an object """
def __init__(self, width, height):
self.width = width
self.height = height
class Color:
""" A class representing a color """
def __init__(self, ns_color):
self.ns_color = ns_color
Color.BLACK = Color(NSColor.blackColor())
Color.BLUE = Color(NSColor.blueColor())
Color.BROWN = Color(NSColor.brownColor())
Color.CYAN = Color(NSColor.cyanColor())
Color.DARK_GRAY = Color(NSColor.darkGrayColor())
Color.GRAY = Color(NSColor.grayColor())
Color.GREEN = Color(NSColor.greenColor())
Color.MAGENTA = Color(NSColor.magentaColor())
Color.ORANGE = Color(NSColor.orangeColor())
Color.PURPLE = Color(NSColor.purpleColor())
Color.RED = Color(NSColor.redColor())
Color.WHITE = Color(NSColor.whiteColor())
Color.YELLOW = Color(NSColor.yellowColor())
class Font:
""" Text font """