@versatiles/style 5.5.2 → 5.7.0
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.
- package/README.MD +36 -33
- package/dist/index.d.ts +539 -65
- package/dist/index.js +782 -217
- package/dist/index.js.map +1 -1
- package/package.json +26 -25
- package/src/color/abstract.ts +145 -26
- package/src/color/hsl.ts +88 -5
- package/src/color/hsv.ts +73 -5
- package/src/color/index.test.ts +0 -20
- package/src/color/index.ts +0 -3
- package/src/color/random.test.ts +21 -0
- package/src/color/rgb.test.ts +40 -72
- package/src/color/rgb.ts +152 -7
- package/src/color/utils.ts +10 -4
- package/src/guess_style/guess_style.test.ts +1 -1
- package/src/guess_style/guess_style.ts +42 -2
- package/src/index.test.ts +2 -1
- package/src/index.ts +89 -4
- package/src/shortbread/layers.ts +30 -5
- package/src/style_builder/recolor.test.ts +46 -0
- package/src/style_builder/recolor.ts +161 -34
- package/src/style_builder/style_builder.test.ts +2 -0
- package/src/style_builder/style_builder.ts +8 -9
- package/src/style_builder/types.ts +23 -58
- package/src/styles/colorful.ts +36 -7
- package/src/styles/index.ts +2 -0
- package/src/styles/shadow.ts +11 -0
package/src/styles/colorful.ts
CHANGED
|
@@ -521,16 +521,28 @@ export default class Colorful extends StyleBuilder {
|
|
|
521
521
|
opacity: { 12: 0, 13: 1 },
|
|
522
522
|
},
|
|
523
523
|
|
|
524
|
-
//
|
|
525
|
-
'{bridge-,tunnel-,}street-
|
|
524
|
+
// tracks
|
|
525
|
+
'{bridge-,tunnel-,}street-track:outline': {
|
|
526
526
|
size: { 14: 2, 16: 4, 18: 18, 19: 48, 20: 96 },
|
|
527
527
|
opacity: { 14: 0, 15: 1 },
|
|
528
528
|
},
|
|
529
|
-
'{bridge-,tunnel-,}street-
|
|
529
|
+
'{bridge-,tunnel-,}street-track': {
|
|
530
530
|
size: { 14: 1, 16: 3, 18: 16, 19: 44, 20: 88 },
|
|
531
531
|
opacity: { 14: 0, 15: 1 },
|
|
532
532
|
},
|
|
533
533
|
|
|
534
|
+
// service
|
|
535
|
+
'{bridge-,tunnel-,}street-service:outline': {
|
|
536
|
+
size: { 14: 1, 16: 3, 18: 12, 19: 32, 20: 48 },
|
|
537
|
+
opacity: { 15: 0, 16: 1 },
|
|
538
|
+
color: colors.streetbg.lighten(0.3),
|
|
539
|
+
},
|
|
540
|
+
'{bridge-,tunnel-,}street-service': {
|
|
541
|
+
size: { 14: 1, 16: 2, 18: 10, 19: 28, 20: 40 },
|
|
542
|
+
opacity: { 15: 0, 16: 1 },
|
|
543
|
+
color: colors.street.darken(0.03),
|
|
544
|
+
},
|
|
545
|
+
|
|
534
546
|
// ways
|
|
535
547
|
'{bridge-,tunnel-,}way-*:outline': {
|
|
536
548
|
size: { 15: 0, 16: 5, 18: 7, 19: 12, 20: 22 },
|
|
@@ -573,7 +585,8 @@ export default class Colorful extends StyleBuilder {
|
|
|
573
585
|
|
|
574
586
|
// cycle streets overlay
|
|
575
587
|
'{bridge-,tunnel-,}street-{tertiary,tertiary-link,unclassified,residential,livingstreet,pedestrian}-bicycle': {
|
|
576
|
-
|
|
588
|
+
lineJoin: 'round',
|
|
589
|
+
lineCap: 'round',
|
|
577
590
|
color: colors.cycle,
|
|
578
591
|
},
|
|
579
592
|
|
|
@@ -591,13 +604,29 @@ export default class Colorful extends StyleBuilder {
|
|
|
591
604
|
// rail, lightrail
|
|
592
605
|
'{tunnel-,bridge-,}transport-{rail,lightrail}:outline': {
|
|
593
606
|
color: colors.rail,
|
|
594
|
-
|
|
607
|
+
minzoom: 8,
|
|
608
|
+
size: { 8: 1, 13: 1, 15: 1, 20: 14 },
|
|
595
609
|
},
|
|
596
610
|
'{tunnel-,bridge-,}transport-{rail,lightrail}': {
|
|
597
611
|
color: colors.rail.lighten(0.25),
|
|
598
|
-
|
|
612
|
+
minzoom: 14,
|
|
613
|
+
size: { 14: 0, 15: 1, 20: 10 },
|
|
599
614
|
lineDasharray: [2, 2],
|
|
600
615
|
},
|
|
616
|
+
|
|
617
|
+
// rail-service, lightrail-service
|
|
618
|
+
'{tunnel-,bridge-,}transport-{rail,lightrail}-service:outline': {
|
|
619
|
+
color: colors.rail,
|
|
620
|
+
minzoom: 14,
|
|
621
|
+
size: { 14: 0, 15: 1, 16: 1, 20: 14 },
|
|
622
|
+
},
|
|
623
|
+
'{tunnel-,bridge-,}transport-{rail,lightrail}-service': {
|
|
624
|
+
color: colors.rail.lighten(0.25),
|
|
625
|
+
minzoom: 15,
|
|
626
|
+
size: { 15: 0, 16: 1, 20: 10 },
|
|
627
|
+
lineDasharray: [2, 2],
|
|
628
|
+
},
|
|
629
|
+
|
|
601
630
|
// subway
|
|
602
631
|
'{tunnel-,bridge-,}transport-subway:outline': {
|
|
603
632
|
color: colors.subway,
|
|
@@ -776,7 +805,7 @@ export default class Colorful extends StyleBuilder {
|
|
|
776
805
|
'marking-oneway{-reverse,}': {
|
|
777
806
|
minzoom: 16,
|
|
778
807
|
image: 'basics:marking-arrow',
|
|
779
|
-
opacity: { 16: 0, 17: 0.
|
|
808
|
+
opacity: { 16: 0, 17: 0.4, 20: 0.4 },
|
|
780
809
|
font: fonts.regular,
|
|
781
810
|
},
|
|
782
811
|
|
package/src/styles/index.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { StyleSpecification } from '@maplibre/maplibre-gl-style-spec';
|
|
|
8
8
|
import Colorful from './colorful.js';
|
|
9
9
|
import Eclipse from './eclipse.js';
|
|
10
10
|
import Graybeard from './graybeard.js';
|
|
11
|
+
import Shadow from './shadow.js';
|
|
11
12
|
import Neutrino from './neutrino.js';
|
|
12
13
|
import Empty from './empty.js';
|
|
13
14
|
|
|
@@ -29,5 +30,6 @@ function getStyleBuilder(styleBuilder: new () => StyleBuilder): StyleBuilderFunc
|
|
|
29
30
|
export const colorful = getStyleBuilder(Colorful);
|
|
30
31
|
export const eclipse = getStyleBuilder(Eclipse);
|
|
31
32
|
export const graybeard = getStyleBuilder(Graybeard);
|
|
33
|
+
export const shadow = getStyleBuilder(Shadow);
|
|
32
34
|
export const neutrino = getStyleBuilder(Neutrino);
|
|
33
35
|
export const empty = getStyleBuilder(Empty);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import Colorful from './colorful.js';
|
|
2
|
+
|
|
3
|
+
export default class Shadow extends Colorful {
|
|
4
|
+
public readonly name: string = 'Shadow';
|
|
5
|
+
|
|
6
|
+
public constructor() {
|
|
7
|
+
super();
|
|
8
|
+
|
|
9
|
+
this.transformDefaultColors(color => color.saturate(-1).invert().brightness(0.2));
|
|
10
|
+
}
|
|
11
|
+
}
|