lovr.math.gammaToLinear

Converts a color from gamma space to linear space.


lr, lg, lb = lovr.math.gammaToLinear(gr, gg, gb)

Arguments

NameTypeDescription
grnumber The red component of the gamma-space color.
ggnumber The green component of the gamma-space color.
gbnumber The blue component of the gamma-space color.

Returns

NameTypeDescription
lrnumber The red component of the resulting linear-space color.
lgnumber The green component of the resulting linear-space color.
lbnumber The blue component of the resulting linear-space color.

A table can also be used.

lr, lg, lb = lovr.math.gammaToLinear(color)

Arguments

NameTypeDescription
colortable A table containing the components of a gamma-space color.

Returns

NameTypeDescription
lrnumber The red component of the resulting linear-space color.
lgnumber The green component of the resulting linear-space color.
lbnumber The blue component of the resulting linear-space color.

Convert a single color channel.

y = lovr.math.gammaToLinear(x)

Arguments

NameTypeDescription
xnumber The color channel to convert.

Returns

NameTypeDescription
ynumber The converted color channel.

See also