15. Colors
Color classes are useful for the functions related to color in ccPointCloud class.
15.1. QColor (from Qt)
The QColor class is the binding of the Qcolor class from Qt.
- class cloudComPy.QColor
- Bases: - pybind11_object- The Qt QColor class provides colors based on RGB, HSV or CMYK values. See Qt documentation. - __init__(*args, **kwargs)
- Overloaded function. - __init__(self: _cloudComPy.QColor) -> None 
 - Default Constructor: invalid Color. - __init__(self: _cloudComPy.QColor, arg0: int, arg1: int, arg2: int, arg3: int) -> None 
 - Constructs a color with the RGB value r, g, b, and the alpha-channel (transparency) value a. - Parameters:
- r (int) – red value (0 to 255) 
- g (int) – green value (0 to 255) 
- b (int) – blue value (0 to 255) 
- a (int) – alpha value (0 to 255) 
 
 - __init__(self: _cloudComPy.QColor, arg0: int) -> None 
 - Constructs a color with the value color. The alpha component is ignored and set to solid. - Parameters:
- rgb (int) – an unsigned int equivalent to an ARGB quadruplet on the format #AARRGGBB. 
 - __init__(self: _cloudComPy.QColor, arg0: _cloudComPy.QRgba64) -> None 
 - Construct a Color with the value rgba64 ( - QRgba64).- Parameters:
- rgba64 (QRgba64) – an rgba64 value. 
 - __init__(self: _cloudComPy.QColor, arg0: QString) -> None 
 - Constructs a named color in the same way as - setNamedColor()using the given name.- The color is left invalid if the name cannot be parsed. - Parameters:
- colorName (string) – the color name following the syntax in - setNamedColor().
 
 - alpha(self: _cloudComPy.QColor) int
- Returns the alpha color component of this color. See Qt documentation. - Returns:
- alpha component int from [0..255] 
- Return type:
- int 
 
 - alphaF(self: _cloudComPy.QColor) float
- Returns the alpha color component of this color. See Qt documentation. - Returns:
- alpha component float from range [0., 1.] 
- Return type:
- float 
 
 - black(self: _cloudComPy.QColor) int
- Returns the black color component of this color. See Qt documentation. - Returns:
- black component int from [0..255] 
- Return type:
- int 
 
 - blackF(self: _cloudComPy.QColor) float
- Returns the black color component of this color. See Qt documentation. - Returns:
- black component float from range [0., 1.] 
- Return type:
- float 
 
 - blue(self: _cloudComPy.QColor) int
- Returns the blue color component of this color. See Qt documentation. - Returns:
- blue component int from [0..255] 
- Return type:
- int 
 
 - blueF(self: _cloudComPy.QColor) float
- Returns the blue color component of this color. See Qt documentation. - Returns:
- blue component float from range [0., 1.] 
- Return type:
- float 
 
 - static colorNames() list[QString]
- Returns a list of strings containing the color names Qt knows about. Static function. See Qt documentation. - Returns:
- list of Qt valid color names 
- Return type:
- list 
 
 - convertTo(self: _cloudComPy.QColor, arg0: _cloudComPy.QColorSpec) _cloudComPy.QColor
- Creates a copy of this color in the format specified by colorSpec. - See - QColorSpec- Parameters:
- spec (int) – color spec 
- Returns:
- converted color 
- Return type:
 
 - cyan(self: _cloudComPy.QColor) int
- Returns the cyan color component of this color. See Qt documentation. - Returns:
- cyan component int from [0..255] 
- Return type:
- int 
 
 - cyanF(self: _cloudComPy.QColor) float
- Returns the cyan color component of this color. See Qt documentation. - Returns:
- cyan component float from range [0., 1.] 
- Return type:
- float 
 
 - darker(self: _cloudComPy.QColor, factor: int = 200) _cloudComPy.QColor
- Returns a darker (or lighter) color, but does not change this object. - If the factor is greater than 100, this functions returns a darker color. Setting factor to 300 returns a color that has one-third the brightness. If the factor is less than 100, the return color is lighter, but we recommend using the lighter() function for this purpose. If the factor is 0 or negative, the return value is unspecified. - The function converts the current RGB color to HSV, divides the value (V) component by factor and converts the color back to RGB. See Qt documentation. - Parameters:
- factor (int,optional) – default value 200 
- Returns:
- new color object 
- Return type:
 
 - static fromCmyk(c: int, m: int, y: int, k: int, a: int = 255) _cloudComPy.QColor
- Static convenience function that returns a QColor constructed from the given CMYK color values: c (cyan), m (magenta), y (yellow), k (black), and a (alpha-channel, i.e. transparency). All the values must be in the range 0-255. See Qt documentation. - Parameters:
- c (int) – cyan 
- m (int) – magenta 
- y (int) – yellow 
- k (int) – black 
- a (int,optional) – alpha, default 255 
 
- Returns:
- a CMYK QColor 
- Return type:
 
 - static fromCmykF(c: float, m: float, y: float, k: float, a: float = 1.0) _cloudComPy.QColor
- Static convenience function that returns a QColor constructed from the given CMYK color values: c (cyan), m (magenta), y (yellow), k (black), and a (alpha-channel, i.e. transparency). All the values must be in the range [0., 1.]. See Qt documentation. - Parameters:
- c (float) – cyan 
- m (float) – magenta 
- y (float) – yellow 
- k (float) – black 
- a (float,optional) – alpha, default 1. 
 
- Returns:
- a CMYK QColor 
- Return type:
 
 - static fromHsl(h: int, s: int, l: int, a: int = 255) _cloudComPy.QColor
- Static convenience function that returns a QColor constructed from the HSL color values: h (hue), s (saturation), l (lightness), and a (alpha-channel, i.e. transparency). The value of s, l, and a must all be in the range 0-255; the value of h must be in the range 0-359. See Qt documentation. - Parameters:
- h (int) – hue 
- s (int) – saturation 
- l (int) – lightness 
- a (int,optional) – alpha, default 255 
 
- Returns:
- an HSL QColor 
- Return type:
 
 - static fromHslF(h: float, s: float, l: float, a: float = 1.0) _cloudComPy.QColor
- Static convenience function that returns a QColor constructed from the HSL color values: h (hue), s (saturation), l (lightness), and a (alpha-channel, i.e. transparency). All the values must be in the range 0.0-1.0. See Qt documentation. - Parameters:
- h (float) – hue 
- s (float) – saturation 
- l (float) – lightness 
- a (float,optional) – alpha, default 1. 
 
- Returns:
- an HSL QColor 
- Return type:
 
 - static fromHsv(h: int, s: int, v: int, a: int = 255) _cloudComPy.QColor
- Static convenience function that returns a QColor constructed from the HSV color values: h (hue), s (saturation), v (value), and a (alpha-channel, i.e. transparency). The value of s, v, and a must all be in the range 0-255; the value of h must be in the range 0-359. See Qt documentation. - Parameters:
- h (int) – hue 
- s (int) – saturation 
- v (int) – value 
- a (int,optional) – alpha, default 255 
 
- Returns:
- an HSV QColor 
- Return type:
 
 - static fromHsvF(h: float, s: float, v: float, a: float = 1.0) _cloudComPy.QColor
- Static convenience function that returns a QColor constructed from the HSV color values: h (hue), s (saturation), v (value), and a (alpha-channel, i.e. transparency). All the values must be in the range 0.0-1.0. See Qt documentation. - Parameters:
- h (float) – hue 
- s (float) – saturation 
- v (float) – value 
- a (float,optional) – alpha, default 255 
 
- Returns:
- an HSV QColor 
- Return type:
 
 - static fromRgb(r: int, g: int, b: int, a: int = 255) _cloudComPy.QColor
- Static convenience function that returns a QColor constructed from the RGB color values, r (red), g (green), b (blue), and a (alpha-channel, i.e. transparency). All the values must be in the range 0-255. See Qt documentation. - Parameters:
- r (int) – red 
- g (int) – green 
- b (int) – blue 
- a (int,optional) – alpha, default 255 
 
- Returns:
- an RGB QColor 
- Return type:
 
 - static fromRgbF(r: float, g: float, b: float, a: float = 1.0) _cloudComPy.QColor
- Static convenience function that returns a QColor constructed from the RGB color values, r (red), g (green), b (blue), and a (alpha-channel, i.e. transparency). All the values must be in the range 0.0-1.0. See Qt documentation. - Parameters:
- r (float) – red 
- g (float) – green 
- b (float) – blue 
- a (float,optional) – alpha, default 1.0 
 
- Returns:
- an RGB QColor 
- Return type:
 
 - static fromRgbUInt(arg0: int) _cloudComPy.QColor
- Static convenience function that returns a QColor constructed from the given unsigned integer value rgb (ARGB quadruplet on the format #AARRGGBB). The alpha component of rgb is ignored (i.e. it is automatically set to 255), use the - fromRgba()function to include the alpha-channel specified by the given QRgb value. See Qt documentation.- Parameters:
- rgb (int) – ARGB quadruplet on the format #AARRGGBB). 
- Returns:
- an RGB QColor 
- Return type:
 
 - static fromRgba(arg0: int) _cloudComPy.QColor
- Static convenience function that returns a QColor constructed from the given unsigned integer value rgb (ARGB quadruplet on the format #AARRGGBB). Unlike the - fromRgbUInt()function, the alpha-channel specified by the given QRgb value is included. See Qt documentation.- Parameters:
- rgb (int) – ARGB quadruplet on the format #AARRGGBB). 
- Returns:
- an RGB QColor 
- Return type:
 
 - static fromRgba64(r: int, g: int, b: int, a: int = 65535) _cloudComPy.QColor
- Static convenience function that returns a QColor constructed from the RGBA64 color values, r (red), g (green), b (blue), and a (alpha-channel, i.e. transparency). All values: unsigned short = 16bit range 0..65535 See Qt documentation. - Parameters:
- r (int) – red 
- g (int) – green 
- b (int) – blue 
- a (int,optional) – alpha, default 65535 
 
- Returns:
- an RGB QColor 
- Return type:
 
 - static fromRgba64Q(arg0: _cloudComPy.QRgba64) _cloudComPy.QColor
- Static convenience function that returns a QColor constructed from the given - QRgba64value rgba64. See Qt documentation.
 - getCmyk(self: _cloudComPy.QColor) list[int]
- Get the cyan, magenta, yellow, black, and alpha-channel (transparency) components of the color’s CMYK value. See Qt documentation. - Returns:
- a tuple (c, m, y, k, a), int values from [0..255] 
- Return type:
- tuple 
 
 - getCmykF(self: _cloudComPy.QColor) list[float]
- Get the cyan, magenta, yellow, black, and alpha-channel (transparency) components of the color’s CMYK value. See Qt documentation. - Returns:
- a tuple (c, m, y, k, a), float values from [0., 1.] 
- Return type:
- tuple 
 
 - getHsl(self: _cloudComPy.QColor) list[int]
- Get the hue, saturation, lightness and alpha-channel (transparency) components of the color’s HSL value. See Qt documentation. - Returns:
- a tuple (h, s, l, a), int values from [-1..359] for hue, [0..255] for saturation, lightness and alpha-channel 
- Return type:
- tuple 
 
 - getHslF(self: _cloudComPy.QColor) list[float]
- Get the hue, saturation, lightness and alpha-channel (transparency) components of the color’s HSL value. See Qt documentation. - Returns:
- a tuple (h, s, l, a), float values from [0., 1.] 
- Return type:
- tuple 
 
 - getHsv(self: _cloudComPy.QColor) list[int]
- Get the hue, saturation, value and alpha-channel (transparency) components of the color’s HSL value. See Qt documentation. - Returns:
- a tuple (h, s, v, a), int values from [-1..359] for hue, [0..255] for saturation, lightness and alpha-channel 
- Return type:
- tuple 
 
 - getHsvF(self: _cloudComPy.QColor) list[float]
- Get the hue, saturation, value and alpha-channel (transparency) components of the color’s HSL value. See Qt documentation. - Returns:
- a tuple (h, s, v, a), float values from [0., 1.] 
- Return type:
- tuple 
 
 - getRgb(self: _cloudComPy.QColor) list[int]
- Get the the red, green, blue, and alpha-channel (transparency) components of the color’s RGB value. See Qt documentation. - Returns:
- a tuple (r, g, b, a), int values from [0..255] 
- Return type:
- tuple 
 
 - getRgbF(self: _cloudComPy.QColor) list[float]
- Get the the red, green, blue, and alpha-channel (transparency) components of the color’s RGB value. See Qt documentation. - Returns:
- a tuple (r, g, b, a), float values from [0., 1.] 
- Return type:
- tuple 
 
 - green(self: _cloudComPy.QColor) int
- Returns the green color component of this color. See Qt documentation. - Returns:
- green component int from [0..255] 
- Return type:
- int 
 
 - greenF(self: _cloudComPy.QColor) float
- Returns the green color component of this color. See Qt documentation. - Returns:
- green component float from range [0., 1.] 
- Return type:
- float 
 
 - hslHue(self: _cloudComPy.QColor) int
- Returns the HSL hue color component of this color. (-1 means achromatic) See Qt documentation. - Returns:
- the HSL hue color component of this color, value from [-1..359] 
- Return type:
- int 
 
 - hslHueF(self: _cloudComPy.QColor) float
- Returns the HSL hue color component of this color. See Qt documentation. - Returns:
- the HSL hue color component of this color, value from [0., 1.] 
- Return type:
- float 
 
 - hslSaturation(self: _cloudComPy.QColor) int
- Returns the HSL saturation color component of this color. See Qt documentation. - Returns:
- the HSL saturation color component of this color, value from [0..255] 
- Return type:
- int 
 
 - hslSaturationF(self: _cloudComPy.QColor) float
- Returns the HSL saturation color component of this color. See Qt documentation. - Returns:
- the HSL saturation color component of this color, value from [0., 1.] 
- Return type:
- float 
 
 - hsvHue(self: _cloudComPy.QColor) int
- Returns the hsv hue color component of this color. (-1 means achromatic) See Qt documentation. - Returns:
- the hsv hue color component of this color, value from [-1..359] 
- Return type:
- int 
 
 - hsvHueF(self: _cloudComPy.QColor) float
- Returns the hsv hue color component of this color. See Qt documentation. - Returns:
- the hsv hue color component of this color, value from [0., 1.] 
- Return type:
- float 
 
 - hsvSaturation(self: _cloudComPy.QColor) int
- Returns the hsv saturation color component of this color. See Qt documentation. - Returns:
- the hsv saturation color component of this color, value from [0..255] 
- Return type:
- int 
 
 - hsvSaturationF(self: _cloudComPy.QColor) float
- Returns the hsv saturation color component of this color. See Qt documentation. - Returns:
- the hsv saturation color component of this color, value from [0., 1.] 
- Return type:
- float 
 
 - hue(self: _cloudComPy.QColor) int
- Returns the HSV hue color component of this color. (-1 means achromatic) - The color is implicitly converted to HSV. See Qt documentation. - Returns:
- the hsv hue color component of this color, value from [-1..359] 
- Return type:
- int 
 
 - hueF(self: _cloudComPy.QColor) float
- Returns the HSV hue color component of this color. - The color is implicitly converted to HSV. See Qt documentation. - Returns:
- the hsv hue color component of this color, value from [0., 1.] 
- Return type:
- float 
 
 - isValid(self: _cloudComPy.QColor) bool
- Returns True if the color is valid; otherwise returns False. See Qt documentation. - Returns:
- True if the color is valid. 
- Return type:
- bool 
 
 - static isValidColor(arg0: QString) bool
- Returns True if the name is a valid color name and can be used to construct a valid QColor object, otherwise returns false. - It uses the same algorithm used in - setNamedColor(). See Qt documentation.- Returns:
- True if the color name is valid. 
- Return type:
- bool 
 
 - lighter(self: _cloudComPy.QColor, factor: int = 150) _cloudComPy.QColor
- Returns a lighter (or darker) color, but does not change this object. - If the factor is greater than 100, this functions returns a lighter color. Setting factor to 150 returns a color that is 50% brighter. If the factor is less than 100, the return color is darker, but we recommend using the darker() function for this purpose. If the factor is 0 or negative, the return value is unspecified. - The function converts the current RGB color to HSV, multiplies the value (V) component by factor and converts the color back to RGB. See Qt documentation. - Parameters:
- factor (int,optional) – default value 150 
- Returns:
- new color object 
- Return type:
 
 - lightness(self: _cloudComPy.QColor) int
- Returns the lightness color component of this color. See Qt documentation. - Returns:
- lightness in [0..255] 
- Return type:
- int 
 
 - lightnessF(self: _cloudComPy.QColor) float
- Returns the lightness color component of this color. See Qt documentation. - Returns:
- lightness in [0., 1.] 
- Return type:
- float 
 
 - magenta(self: _cloudComPy.QColor) int
- Returns the magenta color component of this color. See Qt documentation. - Returns:
- magenta component int from [0..255] 
- Return type:
- int 
 
 - magentaF(self: _cloudComPy.QColor) float
- Returns the magenta color component of this color. See Qt documentation. - Returns:
- magenta component float from range [0., 1.] 
- Return type:
- float 
 
 - name(self: _cloudComPy.QColor) QString
- Returns the name of the color in the format “#RRGGBB”; i.e. a “#” character followed by three two-digit hexadecimal numbers. See Qt documentation. - Returns:
- name of the color in the format “#RRGGBB”. 
- Return type:
- string 
 
 - nameARGB(self: _cloudComPy.QColor) QString
- Returns the name of the color in the format “#AARRGGBB”; i.e. a “#” character followed by four two-digit hexadecimal numbers. See Qt documentation. - Returns:
- name of the color in the format “#AARRGGBB”. 
- Return type:
- string 
 
 - red(self: _cloudComPy.QColor) int
- Returns the red color component of this color. See Qt documentation. - Returns:
- red component int from [0..255] 
- Return type:
- int 
 
 - redF(self: _cloudComPy.QColor) float
- Returns the red color component of this color. See Qt documentation. - Returns:
- red component float from range [0., 1.] 
- Return type:
- float 
 
 - rgb(self: _cloudComPy.QColor) int
- Returns the RGB value of the color. The alpha value is opaque. See Qt documentation. - Returns:
- rgb value (unsigned int equivalent to an ARGB quadruplet on the format #AARRGGBB) 
- Return type:
- int 
 
 - rgba(self: _cloudComPy.QColor) int
- Returns the RGB value of the color, including its alpha. - unsigned int equivalent to an ARGB quadruplet on the format #AARRGGBB rgb = blue + green*256 + red*256**2 + alpha*256**3 (blue, green, red, alpha: unsigned char) For an invalid color, the alpha value of the returned color is unspecified. See Qt documentation. - Returns:
- rgb value (unsigned int equivalent to an ARGB quadruplet on the format #AARRGGBB) 
- Return type:
- int 
 
 - rgba64(self: _cloudComPy.QColor) _cloudComPy.QRgba64
- Returns the RGB64 value of the color, including its alpha. - For an invalid color, the alpha value of the returned color is unspecified. See Qt documentation. - Returns:
- QRgba64 value 
- Return type:
 
 - saturation(self: _cloudComPy.QColor) int
- Returns the HSV saturation color component of this color. - The color is implicitly converted to HSV. See Qt documentation. - Returns:
- saturation in [0..255] 
- Return type:
- int 
 
 - saturationF(self: _cloudComPy.QColor) float
- Returns the HSV saturation color component of this color. - The color is implicitly converted to HSV. See Qt documentation. - Returns:
- saturation in [0., 1.] 
- Return type:
- float 
 
 - setAlpha(self: _cloudComPy.QColor, arg0: int) None
- Sets the alpha of this color to alpha. Integer alpha is specified in the range 0-255. See Qt documentation. - Parameters:
- alpha (int) – alpha is specified in the range 0-255. 
 
 - setAlphaF(self: _cloudComPy.QColor, arg0: float) None
- Sets the alpha of this color to alpha. float alpha is specified in the range [0., 1.] See Qt documentation. - Parameters:
- alpha (float) – alpha is specified in the range [0., 1.]. 
 
 - setBlue(self: _cloudComPy.QColor, arg0: int) None
- Sets the Blue of this color to Blue. Integer Blue is specified in the range 0-255. See Qt documentation. - Parameters:
- Blue (int) – Blue is specified in the range 0-255. 
 
 - setBlueF(self: _cloudComPy.QColor, arg0: float) None
- Sets the Blue of this color to Blue. float Blue is specified in the range [0., 1.] See Qt documentation. - Parameters:
- Blue (float) – Blue is specified in the range [0., 1.]. 
 
 - setCmyk(self: _cloudComPy.QColor, c: int, m: int, y: int, k: int, a: int = 255) None
- Sets the cyan, magenta, yellow, black, and alpha-channel (transparency) components of the color’s CMYK value. - These components can be retrieved individually using the - cyan(), py:meth:magenta, py:meth:yellow, py:meth:black and py:meth:alpha functions. See Qt documentation.- Parameters:
- c (int) – cyan value (0 to 255) 
- m (int) – magenta value (0 to 255) 
- y (int) – yellow value (0 to 255) 
- k (int) – black value (0 to 255) 
- a (int,optional) – alpha value (0 to 255), default 255 
 
 
 - setCmykF(self: _cloudComPy.QColor, c: float, m: float, y: float, k: float, a: float = 1.0) None
- Sets the cyan, magenta, yellow, black, and alpha-channel (transparency) components of the color’s CMYK value. - These components can be retrieved individually using the - cyan(), py:meth:magenta, py:meth:yellow, py:meth:black and py:meth:alpha functions. See Qt documentation.- Parameters:
- c (float) – cyan value from [0., 1.] 
- m (float) – magenta value from [0., 1.] 
- y (float) – yellow value from [0., 1.] 
- k (float) – black value from [0., 1.] 
- a (float,optional) – alpha value from [0., 1.] default 1. 
 
 
 - setGreen(self: _cloudComPy.QColor, arg0: int) None
- Sets the Green of this color to Green. Integer Green is specified in the range 0-255. See Qt documentation. - Parameters:
- Green (int) – Green is specified in the range 0-255. 
 
 - setGreenF(self: _cloudComPy.QColor, arg0: float) None
- Sets the Green of this color to Green. float Green is specified in the range [0., 1.] See Qt documentation. - Parameters:
- Green (float) – Green is specified in the range [0., 1.]. 
 
 - setHsl(self: _cloudComPy.QColor, h: int, s: int, l: int, a: int = 255) None
- Sets a HSL color value; h is the hue, s is the saturation, l is the lightness and a is the alpha component of the HSL color. - The saturation, lightness and alpha-channel values must be in the range 0-255, and the hue value must be greater than -1. [0..359] See Qt documentation. - Parameters:
- h (int) – hue 
- s (int) – saturation 
- l (int) – lightness 
- a (int,optional) – alpha, default value 255 
 
 
 - setHslF(self: _cloudComPy.QColor, h: float, s: float, l: float, a: float = 1.0) None
- Sets a HSL color value; h is the hue, s is the saturation, l is the lightness and a is the alpha component of the HSL color. - All the values must be in the range 0.0-1.0. See Qt documentation. - Parameters:
- h (int) – hue 
- s (int) – saturation 
- l (int) – lightness 
- a (int,optional) – alpha, default value 1.0 
 
 
 - setHsv(self: _cloudComPy.QColor, h: int, s: int, v: int, a: int = 255) None
- Sets a HSV color value; h is the hue, s is the saturation, v is the value and a is the alpha component of the HSV color. - The saturation, value and alpha-channel values must be in the range 0-255, and the hue value must be greater than -1. [0..359] See Qt documentation. - Parameters:
- h (int) – hue 
- s (int) – saturation 
- v (int) – value 
- a (int,optional) – alpha, default value 255 
 
 
 - setHsvF(self: _cloudComPy.QColor, h: float, s: float, v: float, a: float = 1.0) None
- Sets a HSV color value; h is the hue, s is the saturation, v is the value and a is the alpha component of the HSV color. - All the values must be in the range 0.0-1.0. See Qt documentation. - Parameters:
- h (int) – hue 
- s (int) – saturation 
- v (int) – value 
- a (int,optional) – alpha, default value 1.0 
 
 
 - setNamedColor(self: _cloudComPy.QColor, arg0: QString) None
- Sets the RGB value of this QColor to name, which may be in one of these formats: - #RGB (each of R, G, and B is a single hex digit) 
- #RRGGBB 
- #AARRGGBB (Since 5.2) 
- #RRRGGGBBB 
- #RRRRGGGGBBBB 
- A name from the list of colors defined in the list of SVG color keyword names provided by the World Wide Web Consortium; for example, “steelblue” or “gainsboro”. These color names work on all platforms. 
- transparent - representing the absence of a color. 
 - The color is invalid if name cannot be parsed. See Qt documentation. - Parameters:
- colorName (string) – color name. see - colorNames()for a list of valid keyword names
 
 - setRed(self: _cloudComPy.QColor, arg0: int) None
- Sets the Red of this color to Red. Integer Red is specified in the range 0-255. See Qt documentation. - Parameters:
- Red (int) – Red is specified in the range 0-255. 
 
 - setRedF(self: _cloudComPy.QColor, arg0: float) None
- Sets the Red of this color to Red. float Red is specified in the range [0., 1.] See Qt documentation. - Parameters:
- Red (float) – Green is specified in the range [0., 1.]. 
 
 - setRgb(self: _cloudComPy.QColor, r: int, g: int, b: int, a: int = 255) None
- Sets the RGB value to r, g, b and the alpha value to a. - All the values must be in the range 0-255. See Qt documentation. - Parameters:
- r (int) – red 
- g (int) – green 
- b (int) – blue 
- a (int,optional) – alpha 
 
 
 - setRgbF(self: _cloudComPy.QColor, r: float, g: float, b: float, a: float = 1.0) None
- Sets the color channels of this color to r (red), g (green), b (blue) and a (alpha, transparency). - All values must be in the range 0.0-1.0. See Qt documentation. - Parameters:
- r (float) – red 
- g (float) – green 
- b (float) – blue 
- a (float,optional) – alpha 
 
 
 - setRgbUInt(self: _cloudComPy.QColor, arg0: int) None
- Sets the RGB value to rgb (unsigned integer color code). The alpha value is set to opaque. See Qt documentation. - Parameters:
- rgb (int) – unsigned integer color code (ARGB quadruplet on the format #AARRGGBB) 
 
 - setRgba64(self: _cloudComPy.QColor, arg0: _cloudComPy.QRgba64) None
- Sets the RGB64 value to rgba, including its alpha. See Qt documentation. - Parameters:
- rgba (QRgba64) – 64-bit RGB color structure 
 
 - spec(self: _cloudComPy.QColor) _cloudComPy.QColorSpec
- Returns how the color was specified. - See Qt documentation. - Returns:
- spec value 
- Return type:
 
 - toCmyk(self: _cloudComPy.QColor) _cloudComPy.QColor
- Creates and returns a CMYK QColor based on this color. See Qt documentation. - Returns:
- a CMYK QColor based on this color. 
- Return type:
 
 - toHsl(self: _cloudComPy.QColor) _cloudComPy.QColor
- Creates and returns an HSL QColor based on this color. See Qt documentation. - Returns:
- an HSL QColor based on this color. 
- Return type:
 
 - toHsv(self: _cloudComPy.QColor) _cloudComPy.QColor
- Creates and returns an HSV QColor based on this color. See Qt documentation. - Returns:
- an HSV QColor based on this color. 
- Return type:
 
 - toRgb(self: _cloudComPy.QColor) _cloudComPy.QColor
- Creates and returns an RGB QColor based on this color. See Qt documentation. - Returns:
- an RGB QColor based on this color. 
- Return type:
 
 - value(self: _cloudComPy.QColor) int
- Returns the value color component of this color. See Qt documentation. - Returns:
- value color component [0..255] 
- Return type:
- int 
 
 - valueF(self: _cloudComPy.QColor) float
- Returns the value color component of this color. See Qt documentation. - Returns:
- value color component [0., 1.] 
- Return type:
- float 
 
 - yellow(self: _cloudComPy.QColor) int
- Returns the yellow color component of this color. See Qt documentation. - Returns:
- yellow color component [0..255] 
- Return type:
- int 
 
 - yellowF(self: _cloudComPy.QColor) float
- Returns the yellow color component of this color. See Qt documentation. - Returns:
- yellow color component [0., 1.] 
- Return type:
- float 
 
 
15.2. Other Useful Color classes (from Qt)
The QRgba64 class from Qt provide a 64bit data structure to manipulate 16-bit color channels: Red, green, blue and alpha.
- class cloudComPy.QRgba64
- Bases: - pybind11_object- The QRgba64 struct contains a 64-bit RGB color. - QRgba64 is a 64-bit data-structure containing four 16-bit color channels: Red, green, blue and alpha. QRgba64 can be used as a replacement for QRgb when higher precision is needed. In particular a premultiplied QRgba64 can operate on unpremultiplied QRgb without loss of precision except for alpha 0. See Qt documentation. - __init__(self: _cloudComPy.QRgba64) None
- Default constructor 
 - alpha(self: _cloudComPy.QRgba64) int
- Returns the 16-bit alpha channel. See Qt documentation. - Returns:
- alpha 16 bits 
- Return type:
- int) 
 
 - alpha8(self: _cloudComPy.QRgba64) int
- Returns the alpha channel as an 8-bit. See Qt documentation. - Returns:
- alpha 8 bits 
- Return type:
- int 
 
 - blue(self: _cloudComPy.QRgba64) int
- Returns the 16-bit blue color component. See Qt documentation. - Returns:
- blue 16 bits 
- Return type:
- int 
 
 - blue8(self: _cloudComPy.QRgba64) int
- Returns the blue color component as an 8-bit. See Qt documentation. - Returns:
- blue 8 bits 
- Return type:
- int 
 
 - static fromArgb32(arg0: int) _cloudComPy.QRgba64
- Constructs a QRgba64 value from the 32bit ARGB value rgb. See Qt documentation. - Parameters:
- rgb (int) – 32bit ARGB value 
- Returns:
- color. 
- Return type:
 
 - fromQuint64(self: _cloudComPy.QRgba64, arg0: int) _cloudComPy.QRgba64
- Return the color from a 64bit unsigned integer RGBA. See Qt documentation. - Parameters:
- rgba (int) – a 64bit unsigned integer RGBA. 
- Returns:
- color. 
- Return type:
 
 - static fromRgba(arg0: int, arg1: int, arg2: int, arg3: int) _cloudComPy.QRgba64
- Constructs a QRgba64 value from the four 8-bit color channels red, green, blue and alpha. See Qt documentation. - Parameters:
- red (int) – 8bit red value. 
- green (int) – 8bit green value. 
- blue (int) – 8bit blue value. 
- alpha (int) – 8bit alpha value. 
 
- Returns:
- color. 
- Return type:
 
 - static fromRgba64(arg0: int, arg1: int, arg2: int, arg3: int) _cloudComPy.QRgba64
- Constructs a QRgba64 value from the four 16-bit color channels red, green, blue and alpha. See Qt documentation. - Parameters:
- red (int) – 16bit red value. 
- green (int) – 16bit green value. 
- blue (int) – 16bit blue value. 
- alpha (int) – 16bit alpha value. 
 
- Returns:
- color. 
- Return type:
 
 - static fromRgba64Q(arg0: int) _cloudComPy.QRgba64
- Constructs a QRgba64 value from a 64bit unsigned integer RGBA. See Qt documentation. - Parameters:
- rgba (int) – a 64bit unsigned integer RGBA. 
- Returns:
- color. 
- Return type:
 
 - green(self: _cloudComPy.QRgba64) int
- Returns the 16-bit green color component. See Qt documentation. - Returns:
- green 16 bits 
- Return type:
- int 
 
 - green8(self: _cloudComPy.QRgba64) int
- Returns the green color component as an 8-bit. See Qt documentation. - Returns:
- green 8 bits 
- Return type:
- int 
 
 - isOpaque(self: _cloudComPy.QRgba64) bool
- Returns whether the color is fully opaque. See Qt documentation. - Returns:
- True if the color is fully opaque. 
- Return type:
- bool 
 
 - isTransparent(self: _cloudComPy.QRgba64) bool
- Returns whether the color is transparent. See Qt documentation. - Returns:
- True if the color is transparent. 
- Return type:
- bool 
 
 - premultiplied(self: _cloudComPy.QRgba64) _cloudComPy.QRgba64
- Returns the color with the alpha premultiplied. See Qt documentation. - Returns:
- color premultiplied. 
- Return type:
 
 - red(self: _cloudComPy.QRgba64) int
- Returns the 16-bit red color component. See Qt documentation. - Returns:
- red 16 bits 
- Return type:
- int 
 
 - red8(self: _cloudComPy.QRgba64) int
- Returns the red color component as an 8-bit. See Qt documentation. - Returns:
- red 8 bits 
- Return type:
- int 
 
 - setAlpha(self: _cloudComPy.QRgba64, arg0: int) None
- Sets the alpha of this color to alpha. See Qt documentation. - Parameters:
- alpha (int) – alpha value. 
 
 - setBlue(self: _cloudComPy.QRgba64, arg0: int) None
- Sets the blue color component of this color to blue. See Qt documentation. - Parameters:
- blue (int) – blue value. 
 
 - setGreen(self: _cloudComPy.QRgba64, arg0: int) None
- Sets the green color component of this color to green. See Qt documentation. - Parameters:
- green (int) – green value. 
 
 - setRed(self: _cloudComPy.QRgba64, arg0: int) None
- Sets the red color component of this color to red. See Qt documentation. - Parameters:
- red (int) – red value. 
 
 - toArgb32(self: _cloudComPy.QRgba64) int
- Returns the color as a 32-bit ARGB value. See Qt documentation. - Returns:
- 32 bits ARGB color 
- Return type:
- int 
 
 - toQuint64(self: _cloudComPy.QRgba64) int
- Returns the color as a 64bit unsigned integer RGBA. See Qt documentation. - Returns:
- 64bit unsigned integer RGBA. 
- Return type:
- int 
 
 - toRgb16(self: _cloudComPy.QRgba64) int
- Returns the color as a 16-bit RGB value. See Qt documentation. - Returns:
- 16 bits RGB color 
- Return type:
- int 
 
 - unpremultiplied(self: _cloudComPy.QRgba64) _cloudComPy.QRgba64
- Returns the color with the alpha unpremultiplied. See Qt documentation. - Returns:
- color unpremultiplied. 
- Return type:
 
 
- class cloudComPy.QColorSpec
- The type of color specified, either RGB, HSV, CMYK or HSL. See Qt documentation. - Members: - Invalid - Rgb - Hsv - Cmyk - Hsl - Cmyk = <QColorSpec.Cmyk: 3>
 - Hsl = <QColorSpec.Hsl: 4>
 - Hsv = <QColorSpec.Hsv: 2>
 - Invalid = <QColorSpec.Invalid: 0>
 - Rgb = <QColorSpec.Rgb: 1>
 - __init__(self: _cloudComPy.QColorSpec, value: int) None
 - property name
 - property value