コード例 #1
0
ファイル: baseContext.py プロジェクト: LettError/drawbot
 def cmykShadow(self, offset, blur, color):
     if offset is None:
         self._state.shadow = None
         return
     rgbColor = cmyk2rgb(color[0], color[1], color[2], color[3])
     self._state.shadow = self._shadowClass(offset, blur, rgbColor)
     self._state.shadow.cmykColor = self._cmykColorClass(*color)
コード例 #2
0
ファイル: baseContext.py プロジェクト: LettError/drawbot
 def cmykFill(self, c , m, y, k, a=1):
     if c is None:
         self.fill(None)
     else:
         self._state.cmykFillColor = self._cmykColorClass(c, m, y, k, a)
         r, g, b = cmyk2rgb(c, m, y, k)
         self.fill(r, g, b, a)
コード例 #3
0
ファイル: baseContext.py プロジェクト: LettError/drawbot
 def cmykStroke(self, c , m, y, k, a=1):
     if c is None:
         self.stroke(None)
     else:
         self._state.cmykStrokeColor = self._cmykColorClass(c, m, y, k, a)
         r, g, b = cmyk2rgb(c, m, y, k)
         self.stroke(r, g, b, a)
コード例 #4
0
 def cmykShadow(self, offset, blur, color):
     if offset is None:
         self._state.shadow = None
         return
     rgbColor = cmyk2rgb(color[0], color[1], color[2], color[3])
     self._state.shadow = self._shadowClass(offset, blur, rgbColor)
     self._state.shadow.cmykColor = self._cmykColorClass(*color)
コード例 #5
0
 def cmykStroke(self, c, m, y, k, a=1):
     if c is None:
         self.stroke(None)
     else:
         self._state.cmykStrokeColor = self._cmykColorClass(c, m, y, k, a)
         r, g, b = cmyk2rgb(c, m, y, k)
         self.stroke(r, g, b, a)
コード例 #6
0
 def cmykFill(self, c, m, y, k, a=1):
     if c is None:
         self.fill(None)
     else:
         self._state.cmykFillColor = self._cmykColorClass(c, m, y, k, a)
         r, g, b = cmyk2rgb(c, m, y, k)
         self.fill(r, g, b, a)
コード例 #7
0
ファイル: baseContext.py プロジェクト: LettError/drawbot
 def cmykRadialGradient(self, startPoint=None, endPoint=None, colors=None, locations=None, startRadius=0, endRadius=100):
     if startPoint is None:
         self._state.gradient = None
         return
     rgbColors = [cmyk2rgb(color[0], color[1], color[2], color[3]) for color in colors]
     self._state.gradient = self._gradientClass("radial", startPoint, endPoint, rgbColors, locations, startRadius, endRadius)
     self._state.gradient.cmykColors = [self._cmykColorClass(*color) for color in colors]
     self.fill(None)
コード例 #8
0
ファイル: baseContext.py プロジェクト: LettError/drawbot
 def cmykLinearGradient(self, startPoint=None, endPoint=None, colors=None, locations=None):
     if startPoint is None:
         self._state.gradient = None
         return
     rgbColors = [cmyk2rgb(color[0], color[1], color[2], color[3]) for color in colors]
     self._state.gradient = self._gradientClass("linear", startPoint, endPoint, rgbColors, locations)
     self._state.gradient.cmykColors = [self._cmykColorClass(*color) for color in colors]
     self.fill(None)
コード例 #9
0
 def cmykLinearGradient(self,
                        startPoint=None,
                        endPoint=None,
                        colors=None,
                        locations=None):
     if startPoint is None:
         self._state.gradient = None
         self.fill(0)
         return
     rgbColors = [
         cmyk2rgb(color[0], color[1], color[2], color[3])
         for color in colors
     ]
     self._state.gradient = self._gradientClass("linear", startPoint,
                                                endPoint, rgbColors,
                                                locations)
     self._state.gradient.cmykColors = [
         self._cmykColorClass(*color) for color in colors
     ]
     self.fill(None)
コード例 #10
0
 def cmykRadialGradient(self,
                        startPoint=None,
                        endPoint=None,
                        colors=None,
                        locations=None,
                        startRadius=0,
                        endRadius=100):
     if startPoint is None:
         self._state.gradient = None
         self.fill(0)
         return
     rgbColors = [
         cmyk2rgb(color[0], color[1], color[2], color[3])
         for color in colors
     ]
     self._state.gradient = self._gradientClass("radial", startPoint,
                                                endPoint, rgbColors,
                                                locations, startRadius,
                                                endRadius)
     self._state.gradient.cmykColors = [
         self._cmykColorClass(*color) for color in colors
     ]
     self.fill(None)