Skip to content

Commit

Permalink
include latest changes
Browse files Browse the repository at this point in the history
  • Loading branch information
schriftgestalt committed Jun 24, 2016
1 parent c5b1482 commit 006df23
Showing 1 changed file with 16 additions and 19 deletions.
Expand Up @@ -173,33 +173,30 @@ def countGlyph(self, glyph):
points +=1
return contours, points

def shapeColorWellCallback(self, sender):
# update the color from the colorwell
clr = sender.get()
try:
def _convertColor(self, clr):
colorSpaceName = clr.colorSpaceName()
red,grn,blu,alf = 0,0,0,1
if colorSpaceName in ["NSCalibratedWhiteColorSpace", "NSCalibratedBlackColorSpace"]:
red = grn = blu = clr.whiteComponent()
alf = clr.alphaComponent()
elif colorSpaceName in ["NSDeviceRGBColorSpace", "NSCustomColorSpace"]:
red = clr.redComponent()
grn = clr.greenComponent()
blu = clr.blueComponent()
except:
red = clr.whiteComponent()
grn = red
blu = red
alf = clr.alphaComponent()
self.setShapeColor((red, grn, blu, alf)) # set the color in the well
alf = clr.alphaComponent()
return red,grn,blu,alf

def shapeColorWellCallback(self, sender):
# update the color from the colorwell
# check colorspace.
red, grn, blu, alf = self._convertColor(sender.get())
self.setShapeColor((red, grn, blu, alf)) # set the color in the well
self.cbMakePreview(self) # update the preview

def backgroundColorWellCallback(self, sender):
# update the color from the colorwell
clr = sender.get()
try:
red = clr.redComponent()
grn = clr.greenComponent()
blu = clr.blueComponent()
except:
red = clr.whiteComponent()
grn = red
blu = red
alf = clr.alphaComponent()
red, grn, blu, alf = self._convertColor(sender.get())
self.setBackgroundColor((red, grn, blu, alf)) # set the color in the well
self.cbMakePreview(self) # update the preview

Expand Down

0 comments on commit 006df23

Please sign in to comment.