27 lines
16 KiB
JavaScript
27 lines
16 KiB
JavaScript
![]() |
/**
|
||
|
* @license
|
||
|
* Cesium - https://github.com/CesiumGS/cesium
|
||
|
* Version 1.109
|
||
|
*
|
||
|
* Copyright 2011-2022 Cesium Contributors
|
||
|
*
|
||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at
|
||
|
*
|
||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*
|
||
|
* Unless required by applicable law or agreed to in writing, software
|
||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
* See the License for the specific language governing permissions and
|
||
|
* limitations under the License.
|
||
|
*
|
||
|
* Columbus View (Pat. Pend.)
|
||
|
*
|
||
|
* Portions licensed separately.
|
||
|
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
|
||
|
*/
|
||
|
|
||
|
import{e as j}from"./chunk-NNIY7VTE.js";import{a as E}from"./chunk-LI57NJAL.js";import{a as C}from"./chunk-P44SUSQU.js";import{b as n}from"./chunk-FUATUYJ3.js";import{e as O}from"./chunk-ODUTJJQ5.js";function l(r,o,t){return t<0&&(t+=1),t>1&&(t-=1),t*6<1?r+(o-r)*6*t:t*2<1?o:t*3<2?r+(o-r)*(2/3-t)*6:r}function e(r,o,t,f){this.red=C(r,1),this.green=C(o,1),this.blue=C(t,1),this.alpha=C(f,1)}e.fromCartesian4=function(r,o){return n.typeOf.object("cartesian",r),O(o)?(o.red=r.x,o.green=r.y,o.blue=r.z,o.alpha=r.w,o):new e(r.x,r.y,r.z,r.w)};e.fromBytes=function(r,o,t,f,s){return r=e.byteToFloat(C(r,255)),o=e.byteToFloat(C(o,255)),t=e.byteToFloat(C(t,255)),f=e.byteToFloat(C(f,255)),O(s)?(s.red=r,s.green=o,s.blue=t,s.alpha=f,s):new e(r,o,t,f)};e.fromAlpha=function(r,o,t){return n.typeOf.object("color",r),n.typeOf.number("alpha",o),O(t)?(t.red=r.red,t.green=r.green,t.blue=r.blue,t.alpha=o,t):new e(r.red,r.green,r.blue,o)};var A,g,m;j.supportsTypedArrays()&&(A=new ArrayBuffer(4),g=new Uint32Array(A),m=new Uint8Array(A));e.fromRgba=function(r,o){return g[0]=r,e.fromBytes(m[0],m[1],m[2],m[3],o)};e.fromHsl=function(r,o,t,f,s){r=C(r,0)%1,o=C(o,0),t=C(t,0),f=C(f,1);let c=t,b=t,i=t;if(o!==0){let S;t<.5?S=t*(1+o):S=t+o-t*o;let F=2*t-S;c=l(F,S,r+1/3),b=l(F,S,r),i=l(F,S,r-1/3)}return O(s)?(s.red=c,s.green=b,s.blue=i,s.alpha=f,s):new e(c,b,i,f)};e.fromRandom=function(r,o){r=C(r,C.EMPTY_OBJECT);let t=r.red;if(!O(t)){let b=C(r.minimumRed,0),i=C(r.maximumRed,1);n.typeOf.number.lessThanOrEquals("minimumRed",b,i),t=b+E.nextRandomNumber()*(i-b)}let f=r.green;if(!O(f)){let b=C(r.minimumGreen,0),i=C(r.maximumGreen,1);n.typeOf.number.lessThanOrEquals("minimumGreen",b,i),f=b+E.nextRandomNumber()*(i-b)}let s=r.blue;if(!O(s)){let b=C(r.minimumBlue,0),i=C(r.maximumBlue,1);n.typeOf.number.lessThanOrEquals("minimumBlue",b,i),s=b+E.nextRandomNumber()*(i-b)}let c=r.alpha;if(!O(c)){let b=C(r.minimumAlpha,0),i=C(r.maximumAlpha,1);n.typeOf.number.lessThanOrEquals("minumumAlpha",b,i),c=b+E.nextRandomNumber()*(i-b)}return O(o)?(o.red=t,o.green=f,o.blue=s,o.alpha=c,o):new e(t,f,s,c)};var a=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,z=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,p=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,R=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;e.fromCssColorString=function(r,o){n.typeOf.string("color",r),O(o)||(o=new e),r=r.trim();let t=e[r.toUpperCase()];if(O(t))return e.clone(t,o),o;let f=a.exec(r);return f!==null?(o.red=parseInt(f[1],16)/15,o.green=parseInt(f[2],16)/15,o.blue=parseInt(f[3],16)/15,o.alpha=parseInt(C(f[4],"f"),16)/15,o):(f=z.exec(r),f!==null?(o.red=parseInt(f[1],16)/255,o.green=parseInt(f[2],16)/255,o.blue=parseInt(f[3],16)/255,o.alpha=parseInt(C(f[4],"ff"),16)/255,o):(f=p.exec(r),f!==null?(o.red=parseFloat(f[1])/(f[1].substr(-1)==="%"?100:255),o.green=parseFloat(f[2])/(f[2].substr(-1)==="%"?100:255),o.blue=parseFloat(f[3])/(f[3].substr(-1)==="%"?100:255),o.alpha=parseFloat(C(f[4],"1.0")),o):(f=R.exec(r),f!==null?e.fromHsl(parseFloat(f[1])/360,parseFloat(f[2])/100,parseFloat(f[3])/100,parseFloat(C(f[4],"1.0")),o):(o=void 0,o))))};e.packedLength=4;e.pack=function(r,o,t){return n.typeOf.object("value",r),n.defined("array",o),t=C(t,0),o[t++]=r.red,o[t++]=r.green,o[t++]=r.blue,o[t]=r.alpha,o};e.unpack=function(r,o,t){return n.defined("array",r),o=C(o,0),O(t)||(t=new e),t.red=r[o++],t.green=r[o++],t.blue=r[o++],t.alpha=r[o],t};e.byteToFloat=function(r){return r/255};e.floatToByte=function(r){return r===1?255:r*256|0};e.clone=function(r,o){if(O(r))return O(o)?(o.red=r.red,o.green=r.green,o.blue=r.blue,o.alpha=r.alpha,o):new e(r.red,r.green,r.blue,r.alpha)};e.equals=function(r,o){return r===o||O(r)&&O(o)&&r.red===o.red&&r.green===o.green&&r.blue===o.blue&&r.alpha===o.alpha};e.equalsArray=function(r,o,t){return r.red===o[t]&&r.green===o[t+1]&&r.blue===o[t+2]&&r.alpha===o[t+3]};e.prototype.clone=function(r){return e.clone(this,r)};e.prototype.equals=function(r){return e.equals(this,r)};e.pro
|