porescene.color.conversion module¶
Color Space Conversion¶
Some functions to convert color tuples between following color spaces:
HEX
Standard RGB
Normalized standard RGB
Normalized linear RGB
- porescene.color.conversion.hex2rgb(h)[source]¶
Convert HEX into sRGB.
Returns a three-element or four-element
tupledepending on whether or not aalphavalue is given.
- porescene.color.conversion.lnrgb2nrgb(r, g, b, a=None)[source]¶
- Overloads:
r (float), g (float), b (float), a (None) → ColorTupleFloat3
r (float), g (float), b (float), a (float) → ColorTupleFloat4
Converts normalized linear RGB into sRGB in range [0, 1].
- porescene.color.conversion.nrgb2lnrgb(r, g, b, a=None)[source]¶
- Overloads:
r (float), g (float), b (float), a (None) → ColorTupleFloat3
r (float), g (float), b (float), a (float) → ColorTupleFloat4
Converts normalized sRGB into normalized linear RGB.
- porescene.color.conversion.nrgb2rgb(r, g, b, a=None)[source]¶
- Overloads:
r (float), g (float), b (float), a (None) → ColorTupleInt3
r (float), g (float), b (float), a (float) → ColorTupleInt3Float1
Converts sRGB from range [0, 1] into range [0, 255].