Color.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. function Color() {
  2. }
  3. Color.prototype.setColorHex = function(hex) {
  4. Polycode.Color_setColorHex(this.__ptr, hex)
  5. }
  6. Color.prototype.setColorHexRGB = function(hex) {
  7. Polycode.Color_setColorHexRGB(this.__ptr, hex)
  8. }
  9. Color.prototype.setColorHexFromString = function(hex) {
  10. Polycode.Color_setColorHexFromString(this.__ptr, hex)
  11. }
  12. Color.prototype.setColorHexRGBFromString = function(hex) {
  13. Polycode.Color_setColorHexRGBFromString(this.__ptr, hex)
  14. }
  15. Color.prototype.setColorHSV = function(h,s,v) {
  16. Polycode.Color_setColorHSV(this.__ptr, h,s,v)
  17. }
  18. Color.prototype.setColorRGBA = function(r,g,b,a) {
  19. Polycode.Color_setColorRGBA(this.__ptr, r,g,b,a)
  20. }
  21. Color.prototype.setColorRGB = function(r,g,b) {
  22. Polycode.Color_setColorRGB(this.__ptr, r,g,b)
  23. }
  24. Color.prototype.setColor = function(r,g,b,a) {
  25. Polycode.Color_setColor(this.__ptr, r,g,b,a)
  26. }
  27. Color.prototype.blendColor = function(c2,mode,amount,c3) {
  28. Polycode.Color_blendColor(this.__ptr, c2,mode,amount,c3)
  29. }
  30. Color.prototype.Random = function() {
  31. Polycode.Color_Random(this.__ptr)
  32. }
  33. Color.prototype.getBrightness = function() {
  34. Polycode.Color_getBrightness(this.__ptr)
  35. }
  36. Color.prototype.getHue = function() {
  37. Polycode.Color_getHue(this.__ptr)
  38. }
  39. Color.prototype.getSaturation = function() {
  40. Polycode.Color_getSaturation(this.__ptr)
  41. }
  42. Color.prototype.getValue = function() {
  43. Polycode.Color_getValue(this.__ptr)
  44. }
  45. Color.prototype.getUint = function() {
  46. Polycode.Color_getUint(this.__ptr)
  47. }