setColor.lua 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. return {
  2. summary = 'Set a color property of the Material.',
  3. description = [[
  4. Sets a color property for a Material. Different types of colors are supported for different
  5. lighting parameters. Colors default to `(1.0, 1.0, 1.0, 1.0)` and are gamma corrected.
  6. ]],
  7. arguments = {
  8. colorType = {
  9. type = 'MaterialColor',
  10. default = [['diffuse']],
  11. description = 'The type of color to set.'
  12. },
  13. r = {
  14. type = 'number',
  15. description = 'The red component of the color.'
  16. },
  17. g = {
  18. type = 'number',
  19. description = 'The green component of the color.'
  20. },
  21. b = {
  22. type = 'number',
  23. description = 'The blue component of the color.'
  24. },
  25. a = {
  26. type = 'number',
  27. default = '1.0',
  28. description = 'The alpha component of the color.'
  29. },
  30. hex = {
  31. type = 'number',
  32. description = 'A hexcode to use for the color (alpha is not supported).'
  33. }
  34. },
  35. returns = {},
  36. variants = {
  37. {
  38. arguments = { 'colorType', 'r', 'g', 'b', 'a' },
  39. returns = {}
  40. },
  41. {
  42. arguments = { 'r', 'g', 'b', 'a' },
  43. returns = {}
  44. },
  45. {
  46. arguments = { 'colorType', 'hex' },
  47. returns = {}
  48. },
  49. {
  50. arguments = { 'hex' },
  51. returns = {}
  52. }
  53. },
  54. related = {
  55. 'MaterialColor',
  56. 'lovr.graphics.setColor'
  57. }
  58. }