# linear_rgb

Python reference for `nagasim.appearance.linear_rgb`. Provisional: it may change between minor versions, see [Appearance](../../appearance.md).

`nagasim.appearance.linear_rgb`

```python
linear_rgb(rgb)
```

sRGB channels to linear ones, as a glTF base colour takes them.

The colours of a look are sRGB `#RRGGBB`; a glTF `baseColorFactor` is
`linear_rgb(srgb(c))`. Written by hand, so a renderer's embedded Python needs no numpy.

Parameters
----------
rgb : sequence of float
    sRGB channels, each 0 to 1, as `srgb` gives them.

Returns
-------
tuple of float
    The same channels, linear.

See Also
--------
nagasim.appearance.srgb : The sRGB components of a `#RRGGBB` colour.

Examples
--------
>>> from nagasim.appearance import linear_rgb, srgb
>>> [round(c, 4) for c in linear_rgb(srgb("#808080"))]
[0.2159, 0.2159, 0.2159]
