List of all classes, functions and methods in python-igraph
Color handling functions.
Class | Palette |
Base class of color palettes. |
Class | GradientPalette |
Base class for gradient palettes |
Class | AdvancedGradientPalette |
Advanced gradient that consists of more than two base colors. |
Class | RainbowPalette |
A palette that varies the hue of the colors along a scale. |
Class | PrecalculatedPalette |
A palette that returns colors from a pre-calculated list of colors |
Class | ClusterColoringPalette |
A palette suitable for coloring vertices when plotting a clustering. |
Function | clamp |
Clamps the given value between min and max |
Function | color_name_to_rgb |
Converts a color given in one of the supported color formats to R-G-B values. |
Function | color_name_to_rgba |
Converts a color given in one of the supported color formats to R-G-B-A values. |
Function | color_to_html_format |
Formats a color given as a 3-tuple or 4-tuple in HTML format. |
Function | darken |
Creates a darker version of a color given by an RGB triplet. |
Function | hsla_to_rgba |
Converts a color given by its HSLA coordinates (hue, saturation, lightness, alpha) to RGBA coordinates. |
Function | hsl_to_rgb |
Converts a color given by its HSL coordinates (hue, saturation, lightness) to RGB coordinates. |
Function | hsva_to_rgba |
Converts a color given by its HSVA coordinates (hue, saturation, value, alpha) to RGB coordinates. |
Function | hsv_to_rgb |
Converts a color given by its HSV coordinates (hue, saturation, value) to RGB coordinates. |
Function | rgba_to_hsla |
Converts a color given by its RGBA coordinates to HSLA coordinates (hue, saturation, lightness, alpha). |
Function | rgba_to_hsva |
Converts a color given by its RGBA coordinates to HSVA coordinates (hue, saturation, value, alpha). |
Function | rgb_to_hsl |
Converts a color given by its RGB coordinates to HSL coordinates (hue, saturation, lightness). |
Function | rgb_to_hsv |
Converts a color given by its RGB coordinates to HSV coordinates (hue, saturation, value). |
Function | lighten |
Creates a lighter version of a color given by an RGB triplet. |
Variable | known_colors |
Undocumented |
Variable | palettes |
Undocumented |
Converts a color given in one of the supported color formats to R-G-B values.
This is done by calling color_name_to_rgba
and then throwing away the alpha value.
See Also | color_name_to_rgba for more details about what formats are understood by this function. |
Converts a color given in one of the supported color formats to R-G-B-A values.
Examples:
>>> color_name_to_rgba("red") (1.0, 0.0, 0.0, 1.0) >>> color_name_to_rgba("#ff8000") == (1.0, 128/255.0, 0.0, 1.0) True >>> color_name_to_rgba("#ff800080") == (1.0, 128/255.0, 0.0, 128/255.0) True >>> color_name_to_rgba("#08f") == (0.0, 136/255.0, 1.0, 1.0) True >>> color_name_to_rgba("rgb(100%, 50%, 0%)") (1.0, 0.5, 0.0, 1.0) >>> color_name_to_rgba("rgba(100%, 50%, 0%, 25%)") (1.0, 0.5, 0.0, 0.25) >>> color_name_to_rgba("hsla(120, 100%, 50%, 0.5)") (0.0, 1.0, 0.0, 0.5) >>> color_name_to_rgba("hsl(60, 100%, 50%)") (1.0, 1.0, 0.0, 1.0) >>> color_name_to_rgba("hsv(60, 100%, 100%)") (1.0, 1.0, 0.0, 1.0)
Parameters | color | the color to be converted in one of the following formats:
|
palette | the palette to be used if a single number is passed to the method. Must be an instance of colors.Palette . | |
Returns | the RGBA values corresponding to the given color in a 4-tuple. Since these colors are primarily used by Cairo routines, the tuples contain floats in the range 0.0-1.0 |
Formats a color given as a 3-tuple or 4-tuple in HTML format.
The HTML format is simply given by #rrggbbaa
, where rr
gives the red component in hexadecimal format, gg
gives the green component bb
gives the blue component and gg
gives the alpha level. The alpha level is optional.
Creates a darker version of a color given by an RGB triplet.
This is done by mixing the original color with black using the given ratio. A ratio of 1.0 will yield a completely black color, a ratio of 0.0 will yield the original color. The alpha values are left intact.
Converts a color given by its HSLA coordinates (hue, saturation, lightness, alpha) to RGBA coordinates.
Each of the HSLA coordinates must be in the range [0, 1].
Converts a color given by its HSL coordinates (hue, saturation, lightness) to RGB coordinates.
Each of the HSL coordinates must be in the range [0, 1].
Converts a color given by its HSVA coordinates (hue, saturation, value, alpha) to RGB coordinates.
Each of the HSVA coordinates must be in the range [0, 1].
Converts a color given by its HSV coordinates (hue, saturation, value) to RGB coordinates.
Each of the HSV coordinates must be in the range [0, 1].
Converts a color given by its RGBA coordinates to HSLA coordinates (hue, saturation, lightness, alpha).
Each of the RGBA coordinates must be in the range [0, 1].
Converts a color given by its RGBA coordinates to HSVA coordinates (hue, saturation, value, alpha).
Each of the RGBA coordinates must be in the range [0, 1].
Converts a color given by its RGB coordinates to HSL coordinates (hue, saturation, lightness).
Each of the RGB coordinates must be in the range [0, 1].
Converts a color given by its RGB coordinates to HSV coordinates (hue, saturation, value).
Each of the RGB coordinates must be in the range [0, 1].