@mapbox/mapbox-gl-style-spec 14.15.0-beta.1 → 14.15.0-beta.2
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/dist/index.cjs +21 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.es.js +21 -18
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
- package/util/color.ts +21 -26
package/dist/index.es.js
CHANGED
|
@@ -12950,17 +12950,19 @@ class RenderColor {
|
|
|
12950
12950
|
0,
|
|
12951
12951
|
0
|
|
12952
12952
|
];
|
|
12953
|
-
|
|
12954
|
-
|
|
12955
|
-
|
|
12953
|
+
const invA = 1 / a;
|
|
12954
|
+
r *= invA;
|
|
12955
|
+
g *= invA;
|
|
12956
|
+
b *= invA;
|
|
12956
12957
|
}
|
|
12957
12958
|
const red = Math.min(Math.max(r, 0), 1);
|
|
12958
12959
|
const green = Math.min(Math.max(g, 0), 1);
|
|
12959
12960
|
const blue = Math.min(Math.max(b, 0), 1);
|
|
12960
12961
|
const min = Math.min(red, green, blue);
|
|
12961
12962
|
const max = Math.max(red, green, blue);
|
|
12962
|
-
const
|
|
12963
|
-
|
|
12963
|
+
const delta = max - min;
|
|
12964
|
+
const l = (min + max) * 0.5;
|
|
12965
|
+
if (delta === 0) {
|
|
12964
12966
|
return [
|
|
12965
12967
|
0,
|
|
12966
12968
|
0,
|
|
@@ -12968,21 +12970,22 @@ class RenderColor {
|
|
|
12968
12970
|
a
|
|
12969
12971
|
];
|
|
12970
12972
|
}
|
|
12971
|
-
const delta = max - min;
|
|
12972
12973
|
const s = l > 0.5 ? delta / (2 - max - min) : delta / (max + min);
|
|
12973
|
-
let h
|
|
12974
|
-
|
|
12975
|
-
|
|
12976
|
-
|
|
12977
|
-
|
|
12978
|
-
|
|
12979
|
-
h = (
|
|
12980
|
-
|
|
12981
|
-
|
|
12974
|
+
let h;
|
|
12975
|
+
switch (max) {
|
|
12976
|
+
case red:
|
|
12977
|
+
h = ((green - blue) / delta + (green < blue ? 6 : 0)) * 60;
|
|
12978
|
+
break;
|
|
12979
|
+
case green:
|
|
12980
|
+
h = ((blue - red) / delta + 2) * 60;
|
|
12981
|
+
break;
|
|
12982
|
+
default:
|
|
12983
|
+
h = ((red - green) / delta + 4) * 60;
|
|
12984
|
+
}
|
|
12982
12985
|
return [
|
|
12983
|
-
|
|
12984
|
-
|
|
12985
|
-
|
|
12986
|
+
h,
|
|
12987
|
+
s * 100,
|
|
12988
|
+
l * 100,
|
|
12986
12989
|
a
|
|
12987
12990
|
];
|
|
12988
12991
|
}
|