lovr.math.linearToGamma
Converts a color from linear space to gamma space.
gr, gg, gb = lovr.math.linearToGamma(lr, lg, lb)
Arguments
Name | Type | Description |
lr | number | The red component of the linear-space color.
|
lg | number | The green component of the linear-space color.
|
lb | number | The blue component of the linear-space color.
|
Returns
Name | Type | Description |
gr | number | The red component of the resulting gamma-space color.
|
gg | number | The green component of the resulting gamma-space color.
|
gb | number | The blue component of the resulting gamma-space color.
|
A table can also be used.
gr, gg, gb = lovr.math.linearToGamma(color)
Arguments
Name | Type | Description |
color | table | A table containing the components of a linear-space color.
|
Returns
Name | Type | Description |
gr | number | The red component of the resulting gamma-space color.
|
gg | number | The green component of the resulting gamma-space color.
|
gb | number | The blue component of the resulting gamma-space color.
|
Convert a single color channel.
y = lovr.math.linearToGamma(x)
Arguments
Name | Type | Description |
x | number | The color channel to convert.
|
Returns
Name | Type | Description |
y | number | The converted color channel.
|
See also
lovr.math.gammaToLinear
lovr.math