@versatiles/style 5.8.2 → 5.8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/README.md +14 -14
  2. package/dist/index.d.ts +1 -1
  3. package/dist/index.js +570 -333
  4. package/dist/index.js.map +1 -1
  5. package/package.json +13 -8
  6. package/src/color/abstract.ts +1 -1
  7. package/src/color/hsl.test.ts +10 -16
  8. package/src/color/hsl.ts +11 -15
  9. package/src/color/hsv.test.ts +4 -10
  10. package/src/color/hsv.ts +38 -22
  11. package/src/color/index.test.ts +2 -4
  12. package/src/color/index.ts +1 -1
  13. package/src/color/random.test.ts +1 -1
  14. package/src/color/random.ts +127 -25
  15. package/src/color/rgb.test.ts +55 -36
  16. package/src/color/rgb.ts +35 -48
  17. package/src/color/utils.test.ts +4 -6
  18. package/src/color/utils.ts +1 -3
  19. package/src/guess_style/guess_style.test.ts +49 -43
  20. package/src/guess_style/guess_style.ts +64 -21
  21. package/src/guess_style/index.ts +0 -1
  22. package/src/index.test.ts +34 -7
  23. package/src/index.ts +29 -19
  24. package/src/lib/utils.test.ts +2 -2
  25. package/src/lib/utils.ts +2 -1
  26. package/src/shortbread/index.ts +0 -1
  27. package/src/shortbread/layers.test.ts +19 -3
  28. package/src/shortbread/layers.ts +204 -194
  29. package/src/shortbread/properties.test.ts +3 -4
  30. package/src/shortbread/properties.ts +18 -4
  31. package/src/shortbread/template.test.ts +7 -2
  32. package/src/shortbread/template.ts +7 -14
  33. package/src/style_builder/decorator.test.ts +4 -4
  34. package/src/style_builder/decorator.ts +29 -21
  35. package/src/style_builder/recolor.test.ts +6 -31
  36. package/src/style_builder/recolor.ts +20 -20
  37. package/src/style_builder/style_builder.test.ts +50 -13
  38. package/src/style_builder/style_builder.ts +29 -31
  39. package/src/style_builder/types.ts +85 -2
  40. package/src/styles/LICENSE.md +15 -15
  41. package/src/styles/colorful.test.ts +91 -0
  42. package/src/styles/colorful.ts +229 -122
  43. package/src/styles/eclipse.ts +1 -1
  44. package/src/styles/empty.ts +1 -1
  45. package/src/styles/graybeard.ts +2 -2
  46. package/src/styles/index.ts +0 -3
  47. package/src/styles/neutrino.ts +14 -16
  48. package/src/styles/shadow.ts +2 -2
  49. package/src/types/index.ts +0 -1
  50. package/src/types/maplibre.ts +17 -3
  51. package/src/types/tilejson.test.ts +8 -5
  52. package/src/types/tilejson.ts +13 -13
  53. package/src/types/vector_layer.test.ts +4 -1
  54. package/src/types/vector_layer.ts +7 -7
package/README.md CHANGED
@@ -51,16 +51,16 @@ Integrate it into your HTML application:
51
51
  <script src="maplibre-gl.js"></script>
52
52
  <script src="versatiles-style.js"></script>
53
53
  <script>
54
- const style = VersaTilesStyle.graybeard({
55
- language: "de",
56
- colors: { label: "#222" },
57
- recolor: { gamma: 0.5 },
58
- });
59
-
60
- const map = new maplibregl.Map({
61
- container: "map",
62
- style,
63
- });
54
+ const style = VersaTilesStyle.graybeard({
55
+ language: 'de',
56
+ colors: { label: '#222' },
57
+ recolor: { gamma: 0.5 },
58
+ });
59
+
60
+ const map = new maplibregl.Map({
61
+ container: 'map',
62
+ style,
63
+ });
64
64
  </script>
65
65
  ```
66
66
 
@@ -75,13 +75,13 @@ npm install @versatiles/style
75
75
  Generate styles programmatically:
76
76
 
77
77
  ```javascript
78
- import { colorful } from "@versatiles/style";
79
- import { writeFileSync } from "node:fs";
78
+ import { colorful } from '@versatiles/style';
79
+ import { writeFileSync } from 'node:fs';
80
80
 
81
81
  const style = colorful({
82
- language: "en",
82
+ language: 'en',
83
83
  });
84
- writeFileSync("style.json", JSON.stringify(style));
84
+ writeFileSync('style.json', JSON.stringify(style));
85
85
  ```
86
86
 
87
87
  ---
package/dist/index.d.ts CHANGED
@@ -548,7 +548,7 @@ interface RecolorOptions {
548
548
  /**
549
549
  * If true, inverts all colors' brightness.
550
550
  * See also {@link HSL.invertLuminosity}
551
- */
551
+ */
552
552
  invertBrightness?: boolean;
553
553
  /**
554
554
  * Rotate the hue of all colors in degrees (0-360).