ColorStyle.js 561 B

1234567891011121314151617181920212223242526272829303132
  1. import {Style} from "./Style";
  2. /**
  3. * Simple solid color style represented and stored as a CSS color.
  4. *
  5. * @class
  6. * @extends {Style}
  7. * @param {string} color Color of the style, if undefined it is set to black.
  8. */
  9. function ColorStyle(color)
  10. {
  11. /**
  12. * Color of this style object.
  13. *
  14. * @type {string}
  15. */
  16. this.color = color || "#000000";
  17. }
  18. ColorStyle.prototype = Object.create(Style);
  19. ColorStyle.prototype.generate = function(context)
  20. {
  21. return this.color;
  22. };
  23. ColorStyle.prototype.toJSON = function()
  24. {
  25. };
  26. export {ColorStyle};