A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://proplot.readthedocs.io/en/latest/api/proplot.utils.to_hex.html below:

to_hex — ProPlot documentation

ProPlot to_hex
to_hex(color, space='rgb', cycle=None, keep_alpha=True)[source]

Translate the color from an arbitrary colorspace to a HEX string. This is a generalization of matplotlib.colors.to_hex.

Parameters
  • color (color-spec) – The color. Can be a 3-tuple or 4-tuple of channel values, a hex string, a registered color name, a cycle color like 'C0', or a 2-tuple colormap coordinate specification like ('magma', 0.5) (see ColorDatabase for details).

    If space is 'rgb', this is a tuple of RGB values, and any channels are larger than 2, the channels are assumed to be on the 0 to 255 scale and are divided by 255.

  • space ({'rgb', 'hsv', 'hcl', 'hpl', 'hsl'}, optional) – The colorspace for the input channel values. Ignored unless color is a tuple of numbers.

  • cycle (str, default: rc.cycle) – The registered color cycle name used to interpret colors that look like 'C0', 'C1', etc.

  • clip (bool, default: True) – Whether to clip channel values into the valid 0 to 1 range. Setting this to False can result in invalid colors.

  • keep_alpha (bool, default: True) – Whether to keep the opacity channel. If True an 8-digit HEX is returned. Otherwise a 6-digit HEX is returned.

Returns

color (str) – An 8-digit HEX string indicating the red, green, blue, and alpha channel values.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4