Requires

Provides

Color.js

Fills shape with color

License:
Public domain (http://unlicense.org).
Authors:
Yaroslaff Fedin
  1. 21
  2. 22
  3. 23
  4. 24
  5. 25
  6. 26
  7. 27
  8. 28
  9. 29
  10. 30
  11. 31
  12. 32
  13. 33
  14. 34
  15. 35
  16. 36
  17. 37
  18. 38
  19. 39
  20. 40
  21. 41
  22. 42
  23. 43
  24. 44
LSD.Layer.Color = { properties: { color: ['color', 'gradient', 'none'] }, paint: function(color) { if (color) var radial = color['radial-gradient'], gradient = color['gradient'] || color ['linear-gradient']; if (gradient) { return {fillLinear: [gradient]} } else if (!radial) { return {fill: (!color || color == 'none') ? null : color} } } }; LSD.Layer.Fill = { properties: { color: ['color'] }, prefix: 'fill', paint: LSD.Layer.Color.paint };