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.

  1. __init__(self: visp._visp.gui.ColorBlindFriendlyPalette) -> None

Construct a new vp Color Blind Friendly Palette. The default value ** vpColorBlindFriendlyPalette::Palette::COUNT ** is affected.

  1. __init__(self: visp._visp.gui.ColorBlindFriendlyPalette, colorID: visp._visp.gui.ColorBlindFriendlyPalette.Palette) -> None

  2. __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

__init__

Overloaded function.

getAvailableColorsNames

Get the list of available colors names.

get_colorID

Get the ** vpColorBlindFriendlyPalette::Palette ** the object corresponds to.

set_fromString

Set the fromString object.

to_RGB

Cast a ** vpColorBlindFriendlyPalette ** in a vector {R, G, B}.

to_colorRatio

Cast the object in a vector of doubles that belong to the range [0; 1].

to_string

Get the name of the ** vpColorBlindFriendlyPalette ** object.

to_vpColor

Cast a ** vpColorBlindFriendlyPalette ** in a ** vpColor ** object.

Inherited Methods

Operators

__doc__

__init__

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.

__eq__(self, other: object) bool
__ge__(self, other: object) bool
__getstate__(self) int
__gt__(self, other: object) bool
__hash__(self) int
__index__(self) int
__init__(self, value: int)
__int__(self) int
__le__(self, other: object) bool
__lt__(self, other: object) bool
__ne__(self, other: object) bool
__setstate__(self, state: int) None
property name : str
__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: visp._visp.gui.ColorBlindFriendlyPalette) -> None

Construct a new vp Color Blind Friendly Palette. The default value ** vpColorBlindFriendlyPalette::Palette::COUNT ** is affected.

  1. __init__(self: visp._visp.gui.ColorBlindFriendlyPalette, colorID: visp._visp.gui.ColorBlindFriendlyPalette.Palette) -> None

  2. __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 .

set_fromString(self, nameColor: str) bool

Set the fromString object.

Parameters:
nameColor: str

Returns:

true if a match was found and it was possible to set _colorID correctly.false if the input string nameColor did not match any known names.

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 ** .