lovr.math.linearToGamma

Edit

Converts a color from linear space to gamma space.




Arguments

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

Returns

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

A table can also be used.

Arguments

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

Returns

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

Convert a single color channel.

Arguments

NameTypeDescription
xnumber The color channel to convert.

Returns

NameTypeDescription
ynumber The converted color channel.

See also