MCPcopy Create free account
hub / github.com/PageBot/PageBot / stroke

Method stroke

Lib/pagebot/contexts/flatcontext/flatcontext.py:1239–1253  ·  view source on GitHub ↗

Set global stroke color or the color of the formatted string.

(self, c, w=0.5)

Source from the content-addressed store, hash-verified

1237 self._fill = c
1238
1239 def stroke(self, c, w=0.5):
1240 """Set global stroke color or the color of the formatted string."""
1241 if c is None:
1242 c = noColor
1243 elif isinstance(c, (tuple, list)):
1244 c = color(*c)
1245 elif isinstance(c, (int, float)):
1246 c = color(c)
1247
1248 msg = 'FlatContext.stroke: Color "%s" is not Color instance'
1249 assert isinstance(c, Color), (msg % c)
1250 self._stroke = c
1251
1252 if w is not None:
1253 self.strokeWidth(w)
1254
1255 def textStroke(self, c, w=None):
1256 """

Callers 2

textStrokeMethod · 0.95
_getShapeMethod · 0.45

Calls 2

strokeWidthMethod · 0.95
colorFunction · 0.90

Tested by

no test coverage detected