psychopy.colors - For working with colors.

Classes and functions for working with colors.

Overview

Color([color, space, contrast, conematrix])

A class to store colour details, knows what colour space it’s in and can supply colours in any space.

isValidColor(color[, space])

Depreciated as of 2021.0

hex2rgb255(hexColor)

Convert a hex color string (e.g.

Details

class psychopy.colors.Color(color=None, space=None, contrast=None, conematrix=None)[source]

A class to store colour details, knows what colour space it’s in and can supply colours in any space.

property alpha
copy()[source]

Return a duplicate of this colour

property dkl
property dklCart
property dkla
property dklaCart
property hex
property hsv
property hsva
property lms
property lmsa
property named
property opacity
render(space='rgb')[source]
property rgb
property rgb1
property rgb255
property rgba
property rgba1
property rgba255
set(color=None, space=None)[source]

Set the colour of this object - essentially the same as what happens on creation, but without having to initialise a new object.

property srgb
validate(color, space=None)[source]
psychopy.colors.isValidColor(color, space='rgb')[source]

Depreciated as of 2021.0

psychopy.colors.hex2rgb255(hexColor)[source]

Convert a hex color string (e.g. “#05ff66”) into an rgb triplet ranging from 0:255


Back to top