MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / set_foreground

Method set_foreground

lib/matplotlib/backend_bases.py:907–925  ·  view source on GitHub ↗

Set the foreground color. Parameters ---------- fg : :mpltype:`color` isRGBA : bool If *fg* is known to be an ``(r, g, b, a)`` tuple, *isRGBA* can be set to True to improve performance.

(self, fg, isRGBA=False)

Source from the content-addressed store, hash-verified

905 self._dashes = dash_offset, dash_list
906
907 def set_foreground(self, fg, isRGBA=False):
908 """
909 Set the foreground color.
910
911 Parameters
912 ----------
913 fg : :mpltype:`color`
914 isRGBA : bool
915 If *fg* is known to be an ``(r, g, b, a)`` tuple, *isRGBA* can be
916 set to True to improve performance.
917 """
918 if self._forced_alpha and isRGBA:
919 self._rgb = fg[:3] + (self._alpha,)
920 elif self._forced_alpha:
921 self._rgb = colors.to_rgba(fg, self._alpha)
922 elif isRGBA:
923 self._rgb = fg
924 else:
925 self._rgb = colors.to_rgba(fg)
926
927 @_docstring.interpd
928 def set_joinstyle(self, js):

Callers 9

set_alphaMethod · 0.95
drawMethod · 0.45
drawMethod · 0.45
drawMethod · 0.45
draw_pathMethod · 0.45
draw_pathMethod · 0.45
drawMethod · 0.45
_iter_collectionMethod · 0.45

Calls 1

to_rgbaMethod · 0.45

Tested by

no test coverage detected