@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.cjs
CHANGED
|
@@ -12956,17 +12956,19 @@
|
|
|
12956
12956
|
0,
|
|
12957
12957
|
0
|
|
12958
12958
|
];
|
|
12959
|
-
|
|
12960
|
-
|
|
12961
|
-
|
|
12959
|
+
const invA = 1 / a;
|
|
12960
|
+
r *= invA;
|
|
12961
|
+
g *= invA;
|
|
12962
|
+
b *= invA;
|
|
12962
12963
|
}
|
|
12963
12964
|
const red = Math.min(Math.max(r, 0), 1);
|
|
12964
12965
|
const green = Math.min(Math.max(g, 0), 1);
|
|
12965
12966
|
const blue = Math.min(Math.max(b, 0), 1);
|
|
12966
12967
|
const min = Math.min(red, green, blue);
|
|
12967
12968
|
const max = Math.max(red, green, blue);
|
|
12968
|
-
const
|
|
12969
|
-
|
|
12969
|
+
const delta = max - min;
|
|
12970
|
+
const l = (min + max) * 0.5;
|
|
12971
|
+
if (delta === 0) {
|
|
12970
12972
|
return [
|
|
12971
12973
|
0,
|
|
12972
12974
|
0,
|
|
@@ -12974,21 +12976,22 @@
|
|
|
12974
12976
|
a
|
|
12975
12977
|
];
|
|
12976
12978
|
}
|
|
12977
|
-
const delta = max - min;
|
|
12978
12979
|
const s = l > 0.5 ? delta / (2 - max - min) : delta / (max + min);
|
|
12979
|
-
let h
|
|
12980
|
-
|
|
12981
|
-
|
|
12982
|
-
|
|
12983
|
-
|
|
12984
|
-
|
|
12985
|
-
h = (
|
|
12986
|
-
|
|
12987
|
-
|
|
12980
|
+
let h;
|
|
12981
|
+
switch (max) {
|
|
12982
|
+
case red:
|
|
12983
|
+
h = ((green - blue) / delta + (green < blue ? 6 : 0)) * 60;
|
|
12984
|
+
break;
|
|
12985
|
+
case green:
|
|
12986
|
+
h = ((blue - red) / delta + 2) * 60;
|
|
12987
|
+
break;
|
|
12988
|
+
default:
|
|
12989
|
+
h = ((red - green) / delta + 4) * 60;
|
|
12990
|
+
}
|
|
12988
12991
|
return [
|
|
12989
|
-
|
|
12990
|
-
|
|
12991
|
-
|
|
12992
|
+
h,
|
|
12993
|
+
s * 100,
|
|
12994
|
+
l * 100,
|
|
12992
12995
|
a
|
|
12993
12996
|
];
|
|
12994
12997
|
}
|