ColorBlindFriendlyPalette¶
- class ColorBlindFriendlyPalette(*args, **kwargs)¶
Bases:
pybind11_object
Class that furnishes a set of colors that color blind people should be able to distinguish one from another.
Overloaded function.
__init__(self: visp._visp.gui.ColorBlindFriendlyPalette) -> None
Construct a new vp Color Blind Friendly Palette. The default value ** vpColorBlindFriendlyPalette::Palette::COUNT ** is affected.
__init__(self: visp._visp.gui.ColorBlindFriendlyPalette, colorID: visp._visp.gui.ColorBlindFriendlyPalette.Palette) -> None
__init__(self: visp._visp.gui.ColorBlindFriendlyPalette, nameColor: str) -> None
Construct a new vp Color Blind Friendly Palette object from the name of the color. WARNING: if the color is not found, it will be set to ** vpColorBlindFriendlyPalette::Palette::COUNT ** .
- Parameters:
- nameColor
Methods
Overloaded function.
Get the list of available colors names.
Get the ** vpColorBlindFriendlyPalette::Palette ** the object corresponds to.
Set the fromString object.
Cast a ** vpColorBlindFriendlyPalette ** in a vector {R, G, B}.
Cast the object in a vector of doubles that belong to the range [0; 1].
Get the name of the ** vpColorBlindFriendlyPalette ** object.
Cast a ** vpColorBlindFriendlyPalette ** in a ** vpColor ** object.
Inherited Methods
Operators
__doc__
Overloaded function.
__module__
Attributes
Black
Blue
COUNT
Green
Orange
Purple
SkyBlue
Vermillon
Yellow
__annotations__
s_paletteNames
- class Palette(self, value: int)¶
Bases:
pybind11_object
Enum that list the different available colors.
Values:
Black: Color that looks like black for non-colorblind people.
Orange: Color that looks like orange for non-colorblind people.
SkyBlue: Color that looks like sky blue for non-colorblind people.
Green: Color that looks like green for non-colorblind people.
Yellow: Color that looks like yellow for non-colorblind people.
Blue: Color that looks like blue for non-colorblind people.
Vermillon: Color that looks like vermilion for non-colorblind people.
Purple: Color that looks like purple for non-colorblind people.
COUNT: Number of colors the palette proposes.
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: visp._visp.gui.ColorBlindFriendlyPalette) -> None
Construct a new vp Color Blind Friendly Palette. The default value ** vpColorBlindFriendlyPalette::Palette::COUNT ** is affected.
__init__(self: visp._visp.gui.ColorBlindFriendlyPalette, colorID: visp._visp.gui.ColorBlindFriendlyPalette.Palette) -> None
__init__(self: visp._visp.gui.ColorBlindFriendlyPalette, nameColor: str) -> None
Construct a new vp Color Blind Friendly Palette object from the name of the color. WARNING: if the color is not found, it will be set to ** vpColorBlindFriendlyPalette::Palette::COUNT ** .
- Parameters:
- nameColor
- static getAvailableColorsNames(prefix: str =, separator: str =, suffix: str =) str ¶
Get the list of available colors names.
- Parameters:
- prefix
Optional prefix that will be written before starting the list.
- separator
Optional separator between each member of the list.
- suffix
Optional suffix that will be written after ending the list.
- Returns:
std::string The list of names of the available colors.
- get_colorID(self) visp._visp.gui.ColorBlindFriendlyPalette.Palette ¶
Get the ** vpColorBlindFriendlyPalette::Palette ** the object corresponds to.
- Returns:
Palette Return vpColorBlindFriendlyPalette::_colorID .
- to_RGB(self) list[int] ¶
Cast a ** vpColorBlindFriendlyPalette ** in a vector {R, G, B}. A ** vpColorBlindFriendlyPalette::Palette::COUNT ** object is set as white, i.e. {255, 255, 255}.
- Returns:
std::vector<unsigned char> A vector containing the R, g, B components (in his order), expressed as an unsigned char (so between 0 and 255).
- to_colorRatio(self) list[float] ¶
Cast the object in a vector of doubles that belong to the range [0; 1]. The initial R, G, B values are divided by 255. For instance a pixel whose RGB values would be {0; 127.5; 255.} would be transformed in a vector {0.; 0.5; 1.0}.
- Returns:
std::vector<double> R, G, B values normalized in doubles in the range [0; 1.] by dividing the original values by 255.
- to_string(self) str ¶
Get the name of the ** vpColorBlindFriendlyPalette ** object.
- Returns:
std::string The name of the color.
- to_vpColor(self) visp._visp.core.Color ¶
Cast a ** vpColorBlindFriendlyPalette ** in a ** vpColor ** object. A ** vpColorBlindFriendlyPalette::Palette::COUNT ** object is set as white (255, 255, 255).
- Returns:
vpColor The ** vpColor ** corresponding to the RGB values of the ** vpColorBlindFriendlyPalette ** .