linearToGamma.lua 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. return {
  2. tag = 'mathOther',
  3. summary = ' Convert a color from linear space to gamma space.',
  4. description = 'Converts a color from linear space to gamma space.',
  5. arguments = {
  6. lr = {
  7. type = 'number',
  8. description = 'The red component of the linear-space color.'
  9. },
  10. lg = {
  11. type = 'number',
  12. description = 'The green component of the linear-space color.'
  13. },
  14. lb = {
  15. type = 'number',
  16. description = 'The blue component of the linear-space color.'
  17. },
  18. color = {
  19. type = 'table',
  20. description = 'A table containing the components of a linear-space color.'
  21. },
  22. x = {
  23. type = 'number',
  24. description = 'The color channel to convert.'
  25. }
  26. },
  27. returns = {
  28. gr = {
  29. type = 'number',
  30. description = 'The red component of the resulting gamma-space color.'
  31. },
  32. gg = {
  33. type = 'number',
  34. description = 'The green component of the resulting gamma-space color.'
  35. },
  36. gb = {
  37. type = 'number',
  38. description = 'The blue component of the resulting gamma-space color.'
  39. },
  40. y = {
  41. type = 'number',
  42. description = 'The converted color channel.'
  43. }
  44. },
  45. variants = {
  46. {
  47. arguments = { 'lr', 'lg', 'lb' },
  48. returns = { 'gr', 'gg', 'gb' }
  49. },
  50. {
  51. description = 'A table can also be used.',
  52. arguments = { 'color' },
  53. returns = { 'gr', 'gg', 'gb' }
  54. },
  55. {
  56. description = 'Convert a single color channel.',
  57. arguments = { 'x' },
  58. returns = { 'y' }
  59. }
  60. },
  61. related = {
  62. 'lovr.math.gammaToLinear'
  63. }
  64. }