Color-63c0bcb4.js 81 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172
  1. /* This file is automatically rebuilt by the Cesium build process. */
  2. define(['exports', './defined-26bd4a03', './Check-da037458', './freezeObject-2d83f591', './defaultValue-f2e68450', './Math-fa6e45cb', './Transforms-65aba0a4'], function (exports, defined, Check, freezeObject, defaultValue, _Math, Transforms) { 'use strict';
  3. function hue2rgb(m1, m2, h) {
  4. if (h < 0) {
  5. h += 1;
  6. }
  7. if (h > 1) {
  8. h -= 1;
  9. }
  10. if (h * 6 < 1) {
  11. return m1 + (m2 - m1) * 6 * h;
  12. }
  13. if (h * 2 < 1) {
  14. return m2;
  15. }
  16. if (h * 3 < 2) {
  17. return m1 + (m2 - m1) * (2 / 3 - h) * 6;
  18. }
  19. return m1;
  20. }
  21. /**
  22. * A color, specified using red, green, blue, and alpha values,
  23. * which range from <code>0</code> (no intensity) to <code>1.0</code> (full intensity).
  24. * @param {Number} [red=1.0] The red component.
  25. * @param {Number} [green=1.0] The green component.
  26. * @param {Number} [blue=1.0] The blue component.
  27. * @param {Number} [alpha=1.0] The alpha component.
  28. *
  29. * @constructor
  30. * @alias Color
  31. *
  32. * @see Packable
  33. */
  34. function Color(red, green, blue, alpha) {
  35. /**
  36. * The red component.
  37. * @type {Number}
  38. * @default 1.0
  39. */
  40. this.red = defaultValue.defaultValue(red, 1.0);
  41. /**
  42. * The green component.
  43. * @type {Number}
  44. * @default 1.0
  45. */
  46. this.green = defaultValue.defaultValue(green, 1.0);
  47. /**
  48. * The blue component.
  49. * @type {Number}
  50. * @default 1.0
  51. */
  52. this.blue = defaultValue.defaultValue(blue, 1.0);
  53. /**
  54. * The alpha component.
  55. * @type {Number}
  56. * @default 1.0
  57. */
  58. this.alpha = defaultValue.defaultValue(alpha, 1.0);
  59. }
  60. /**
  61. * Creates a Color instance from a {@link Cartesian4}. <code>x</code>, <code>y</code>, <code>z</code>,
  62. * and <code>w</code> map to <code>red</code>, <code>green</code>, <code>blue</code>, and <code>alpha</code>, respectively.
  63. *
  64. * @param {Cartesian4} cartesian The source cartesian.
  65. * @param {Color} [result] The object onto which to store the result.
  66. * @returns {Color} The modified result parameter or a new Color instance if one was not provided.
  67. */
  68. Color.fromCartesian4 = function(cartesian, result) {
  69. //>>includeStart('debug', pragmas.debug);
  70. Check.Check.typeOf.object('cartesian', cartesian);
  71. //>>includeEnd('debug');
  72. if (!defined.defined(result)) {
  73. return new Color(cartesian.x, cartesian.y, cartesian.z, cartesian.w);
  74. }
  75. result.red = cartesian.x;
  76. result.green = cartesian.y;
  77. result.blue = cartesian.z;
  78. result.alpha = cartesian.w;
  79. return result;
  80. };
  81. /**
  82. * Creates a new Color specified using red, green, blue, and alpha values
  83. * that are in the range of 0 to 255, converting them internally to a range of 0.0 to 1.0.
  84. *
  85. * @param {Number} [red=255] The red component.
  86. * @param {Number} [green=255] The green component.
  87. * @param {Number} [blue=255] The blue component.
  88. * @param {Number} [alpha=255] The alpha component.
  89. * @param {Color} [result] The object onto which to store the result.
  90. * @returns {Color} The modified result parameter or a new Color instance if one was not provided.
  91. */
  92. Color.fromBytes = function(red, green, blue, alpha, result) {
  93. red = Color.byteToFloat(defaultValue.defaultValue(red, 255.0));
  94. green = Color.byteToFloat(defaultValue.defaultValue(green, 255.0));
  95. blue = Color.byteToFloat(defaultValue.defaultValue(blue, 255.0));
  96. alpha = Color.byteToFloat(defaultValue.defaultValue(alpha, 255.0));
  97. if (!defined.defined(result)) {
  98. return new Color(red, green, blue, alpha);
  99. }
  100. result.red = red;
  101. result.green = green;
  102. result.blue = blue;
  103. result.alpha = alpha;
  104. return result;
  105. };
  106. /**
  107. * Creates a new Color that has the same red, green, and blue components
  108. * of the specified color, but with the specified alpha value.
  109. *
  110. * @param {Color} color The base color
  111. * @param {Number} alpha The new alpha component.
  112. * @param {Color} [result] The object onto which to store the result.
  113. * @returns {Color} The modified result parameter or a new Color instance if one was not provided.
  114. *
  115. * @example var translucentRed = Cesium.Color.fromAlpha(Cesium.Color.RED, 0.9);
  116. */
  117. Color.fromAlpha = function(color, alpha, result) {
  118. //>>includeStart('debug', pragmas.debug);
  119. Check.Check.typeOf.object('color', color);
  120. Check.Check.typeOf.number('alpha', alpha);
  121. //>>includeEnd('debug');
  122. if (!defined.defined(result)) {
  123. return new Color(color.red, color.green, color.blue, alpha);
  124. }
  125. result.red = color.red;
  126. result.green = color.green;
  127. result.blue = color.blue;
  128. result.alpha = alpha;
  129. return result;
  130. };
  131. var scratchArrayBuffer;
  132. var scratchUint32Array;
  133. var scratchUint8Array;
  134. if (Transforms.FeatureDetection.supportsTypedArrays()) {
  135. scratchArrayBuffer = new ArrayBuffer(4);
  136. scratchUint32Array = new Uint32Array(scratchArrayBuffer);
  137. scratchUint8Array = new Uint8Array(scratchArrayBuffer);
  138. }
  139. /**
  140. * Creates a new Color from a single numeric unsigned 32-bit RGBA value, using the endianness
  141. * of the system.
  142. *
  143. * @param {Number} rgba A single numeric unsigned 32-bit RGBA value.
  144. * @param {Color} [result] The object to store the result in, if undefined a new instance will be created.
  145. * @returns {Color} The color object.
  146. *
  147. * @example
  148. * var color = Cesium.Color.fromRgba(0x67ADDFFF);
  149. *
  150. * @see Color#toRgba
  151. */
  152. Color.fromRgba = function(rgba, result) {
  153. // scratchUint32Array and scratchUint8Array share an underlying array buffer
  154. scratchUint32Array[0] = rgba;
  155. return Color.fromBytes(scratchUint8Array[0], scratchUint8Array[1], scratchUint8Array[2], scratchUint8Array[3], result);
  156. };
  157. /**
  158. * Creates a Color instance from hue, saturation, and lightness.
  159. *
  160. * @param {Number} [hue=0] The hue angle 0...1
  161. * @param {Number} [saturation=0] The saturation value 0...1
  162. * @param {Number} [lightness=0] The lightness value 0...1
  163. * @param {Number} [alpha=1.0] The alpha component 0...1
  164. * @param {Color} [result] The object to store the result in, if undefined a new instance will be created.
  165. * @returns {Color} The color object.
  166. *
  167. * @see {@link http://www.w3.org/TR/css3-color/#hsl-color|CSS color values}
  168. */
  169. Color.fromHsl = function(hue, saturation, lightness, alpha, result) {
  170. hue = defaultValue.defaultValue(hue, 0.0) % 1.0;
  171. saturation = defaultValue.defaultValue(saturation, 0.0);
  172. lightness = defaultValue.defaultValue(lightness, 0.0);
  173. alpha = defaultValue.defaultValue(alpha, 1.0);
  174. var red = lightness;
  175. var green = lightness;
  176. var blue = lightness;
  177. if (saturation !== 0) {
  178. var m2;
  179. if (lightness < 0.5) {
  180. m2 = lightness * (1 + saturation);
  181. } else {
  182. m2 = lightness + saturation - lightness * saturation;
  183. }
  184. var m1 = 2.0 * lightness - m2;
  185. red = hue2rgb(m1, m2, hue + 1 / 3);
  186. green = hue2rgb(m1, m2, hue);
  187. blue = hue2rgb(m1, m2, hue - 1 / 3);
  188. }
  189. if (!defined.defined(result)) {
  190. return new Color(red, green, blue, alpha);
  191. }
  192. result.red = red;
  193. result.green = green;
  194. result.blue = blue;
  195. result.alpha = alpha;
  196. return result;
  197. };
  198. /**
  199. * Creates a random color using the provided options. For reproducible random colors, you should
  200. * call {@link CesiumMath#setRandomNumberSeed} once at the beginning of your application.
  201. *
  202. * @param {Object} [options] Object with the following properties:
  203. * @param {Number} [options.red] If specified, the red component to use instead of a randomized value.
  204. * @param {Number} [options.minimumRed=0.0] The maximum red value to generate if none was specified.
  205. * @param {Number} [options.maximumRed=1.0] The minimum red value to generate if none was specified.
  206. * @param {Number} [options.green] If specified, the green component to use instead of a randomized value.
  207. * @param {Number} [options.minimumGreen=0.0] The maximum green value to generate if none was specified.
  208. * @param {Number} [options.maximumGreen=1.0] The minimum green value to generate if none was specified.
  209. * @param {Number} [options.blue] If specified, the blue component to use instead of a randomized value.
  210. * @param {Number} [options.minimumBlue=0.0] The maximum blue value to generate if none was specified.
  211. * @param {Number} [options.maximumBlue=1.0] The minimum blue value to generate if none was specified.
  212. * @param {Number} [options.alpha] If specified, the alpha component to use instead of a randomized value.
  213. * @param {Number} [options.minimumAlpha=0.0] The maximum alpha value to generate if none was specified.
  214. * @param {Number} [options.maximumAlpha=1.0] The minimum alpha value to generate if none was specified.
  215. * @param {Color} [result] The object to store the result in, if undefined a new instance will be created.
  216. * @returns {Color} The modified result parameter or a new instance if result was undefined.
  217. *
  218. * @exception {DeveloperError} minimumRed must be less than or equal to maximumRed.
  219. * @exception {DeveloperError} minimumGreen must be less than or equal to maximumGreen.
  220. * @exception {DeveloperError} minimumBlue must be less than or equal to maximumBlue.
  221. * @exception {DeveloperError} minimumAlpha must be less than or equal to maximumAlpha.
  222. *
  223. * @example
  224. * //Create a completely random color
  225. * var color = Cesium.Color.fromRandom();
  226. *
  227. * //Create a random shade of yellow.
  228. * var color = Cesium.Color.fromRandom({
  229. * red : 1.0,
  230. * green : 1.0,
  231. * alpha : 1.0
  232. * });
  233. *
  234. * //Create a random bright color.
  235. * var color = Cesium.Color.fromRandom({
  236. * minimumRed : 0.75,
  237. * minimumGreen : 0.75,
  238. * minimumBlue : 0.75,
  239. * alpha : 1.0
  240. * });
  241. */
  242. Color.fromRandom = function(options, result) {
  243. options = defaultValue.defaultValue(options, defaultValue.defaultValue.EMPTY_OBJECT);
  244. var red = options.red;
  245. if (!defined.defined(red)) {
  246. var minimumRed = defaultValue.defaultValue(options.minimumRed, 0);
  247. var maximumRed = defaultValue.defaultValue(options.maximumRed, 1.0);
  248. //>>includeStart('debug', pragmas.debug);
  249. Check.Check.typeOf.number.lessThanOrEquals('minimumRed', minimumRed, maximumRed);
  250. //>>includeEnd('debug');
  251. red = minimumRed + (_Math.CesiumMath.nextRandomNumber() * (maximumRed - minimumRed));
  252. }
  253. var green = options.green;
  254. if (!defined.defined(green)) {
  255. var minimumGreen = defaultValue.defaultValue(options.minimumGreen, 0);
  256. var maximumGreen = defaultValue.defaultValue(options.maximumGreen, 1.0);
  257. //>>includeStart('debug', pragmas.debug);
  258. Check.Check.typeOf.number.lessThanOrEquals('minimumGreen', minimumGreen, maximumGreen);
  259. //>>includeEnd('debug');
  260. green = minimumGreen + (_Math.CesiumMath.nextRandomNumber() * (maximumGreen - minimumGreen));
  261. }
  262. var blue = options.blue;
  263. if (!defined.defined(blue)) {
  264. var minimumBlue = defaultValue.defaultValue(options.minimumBlue, 0);
  265. var maximumBlue = defaultValue.defaultValue(options.maximumBlue, 1.0);
  266. //>>includeStart('debug', pragmas.debug);
  267. Check.Check.typeOf.number.lessThanOrEquals('minimumBlue', minimumBlue, maximumBlue);
  268. //>>includeEnd('debug');
  269. blue = minimumBlue + (_Math.CesiumMath.nextRandomNumber() * (maximumBlue - minimumBlue));
  270. }
  271. var alpha = options.alpha;
  272. if (!defined.defined(alpha)) {
  273. var minimumAlpha = defaultValue.defaultValue(options.minimumAlpha, 0);
  274. var maximumAlpha = defaultValue.defaultValue(options.maximumAlpha, 1.0);
  275. //>>includeStart('debug', pragmas.debug);
  276. Check.Check.typeOf.number.lessThanOrEquals('minumumAlpha', minimumAlpha, maximumAlpha);
  277. //>>includeEnd('debug');
  278. alpha = minimumAlpha + (_Math.CesiumMath.nextRandomNumber() * (maximumAlpha - minimumAlpha));
  279. }
  280. if (!defined.defined(result)) {
  281. return new Color(red, green, blue, alpha);
  282. }
  283. result.red = red;
  284. result.green = green;
  285. result.blue = blue;
  286. result.alpha = alpha;
  287. return result;
  288. };
  289. //#rgb
  290. var rgbMatcher = /^#([0-9a-f])([0-9a-f])([0-9a-f])$/i;
  291. //#rrggbb
  292. var rrggbbMatcher = /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i;
  293. //rgb(), rgba(), or rgb%()
  294. var rgbParenthesesMatcher = /^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i;
  295. //hsl(), hsla(), or hsl%()
  296. var hslParenthesesMatcher = /^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;
  297. /**
  298. * Creates a Color instance from a CSS color value.
  299. *
  300. * @param {String} color The CSS color value in #rgb, #rrggbb, rgb(), rgba(), hsl(), or hsla() format.
  301. * @param {Color} [result] The object to store the result in, if undefined a new instance will be created.
  302. * @returns {Color} The color object, or undefined if the string was not a valid CSS color.
  303. *
  304. *
  305. * @example
  306. * var cesiumBlue = Cesium.Color.fromCssColorString('#67ADDF');
  307. * var green = Cesium.Color.fromCssColorString('green');
  308. *
  309. * @see {@link http://www.w3.org/TR/css3-color|CSS color values}
  310. */
  311. Color.fromCssColorString = function(color, result) {
  312. //>>includeStart('debug', pragmas.debug);
  313. Check.Check.typeOf.string('color', color);
  314. //>>includeEnd('debug');
  315. if (!defined.defined(result)) {
  316. result = new Color();
  317. }
  318. var namedColor = Color[color.toUpperCase()];
  319. if (defined.defined(namedColor)) {
  320. Color.clone(namedColor, result);
  321. return result;
  322. }
  323. var matches = rgbMatcher.exec(color);
  324. if (matches !== null) {
  325. result.red = parseInt(matches[1], 16) / 15;
  326. result.green = parseInt(matches[2], 16) / 15.0;
  327. result.blue = parseInt(matches[3], 16) / 15.0;
  328. result.alpha = 1.0;
  329. return result;
  330. }
  331. matches = rrggbbMatcher.exec(color);
  332. if (matches !== null) {
  333. result.red = parseInt(matches[1], 16) / 255.0;
  334. result.green = parseInt(matches[2], 16) / 255.0;
  335. result.blue = parseInt(matches[3], 16) / 255.0;
  336. result.alpha = 1.0;
  337. return result;
  338. }
  339. matches = rgbParenthesesMatcher.exec(color);
  340. if (matches !== null) {
  341. result.red = parseFloat(matches[1]) / ('%' === matches[1].substr(-1) ? 100.0 : 255.0);
  342. result.green = parseFloat(matches[2]) / ('%' === matches[2].substr(-1) ? 100.0 : 255.0);
  343. result.blue = parseFloat(matches[3]) / ('%' === matches[3].substr(-1) ? 100.0 : 255.0);
  344. result.alpha = parseFloat(defaultValue.defaultValue(matches[4], '1.0'));
  345. return result;
  346. }
  347. matches = hslParenthesesMatcher.exec(color);
  348. if (matches !== null) {
  349. return Color.fromHsl(parseFloat(matches[1]) / 360.0,
  350. parseFloat(matches[2]) / 100.0,
  351. parseFloat(matches[3]) / 100.0,
  352. parseFloat(defaultValue.defaultValue(matches[4], '1.0')), result);
  353. }
  354. result = undefined;
  355. return result;
  356. };
  357. /**
  358. * The number of elements used to pack the object into an array.
  359. * @type {Number}
  360. */
  361. Color.packedLength = 4;
  362. /**
  363. * Stores the provided instance into the provided array.
  364. *
  365. * @param {Color} value The value to pack.
  366. * @param {Number[]} array The array to pack into.
  367. * @param {Number} [startingIndex=0] The index into the array at which to start packing the elements.
  368. *
  369. * @returns {Number[]} The array that was packed into
  370. */
  371. Color.pack = function(value, array, startingIndex) {
  372. //>>includeStart('debug', pragmas.debug);
  373. Check.Check.typeOf.object('value', value);
  374. Check.Check.defined('array', array);
  375. //>>includeEnd('debug');
  376. startingIndex = defaultValue.defaultValue(startingIndex, 0);
  377. array[startingIndex++] = value.red;
  378. array[startingIndex++] = value.green;
  379. array[startingIndex++] = value.blue;
  380. array[startingIndex] = value.alpha;
  381. return array;
  382. };
  383. /**
  384. * Retrieves an instance from a packed array.
  385. *
  386. * @param {Number[]} array The packed array.
  387. * @param {Number} [startingIndex=0] The starting index of the element to be unpacked.
  388. * @param {Color} [result] The object into which to store the result.
  389. * @returns {Color} The modified result parameter or a new Color instance if one was not provided.
  390. */
  391. Color.unpack = function(array, startingIndex, result) {
  392. //>>includeStart('debug', pragmas.debug);
  393. Check.Check.defined('array', array);
  394. //>>includeEnd('debug');
  395. startingIndex = defaultValue.defaultValue(startingIndex, 0);
  396. if (!defined.defined(result)) {
  397. result = new Color();
  398. }
  399. result.red = array[startingIndex++];
  400. result.green = array[startingIndex++];
  401. result.blue = array[startingIndex++];
  402. result.alpha = array[startingIndex];
  403. return result;
  404. };
  405. /**
  406. * Converts a 'byte' color component in the range of 0 to 255 into
  407. * a 'float' color component in the range of 0 to 1.0.
  408. *
  409. * @param {Number} number The number to be converted.
  410. * @returns {Number} The converted number.
  411. */
  412. Color.byteToFloat = function(number) {
  413. return number / 255.0;
  414. };
  415. /**
  416. * Converts a 'float' color component in the range of 0 to 1.0 into
  417. * a 'byte' color component in the range of 0 to 255.
  418. *
  419. * @param {Number} number The number to be converted.
  420. * @returns {Number} The converted number.
  421. */
  422. Color.floatToByte = function(number) {
  423. return number === 1.0 ? 255.0 : (number * 256.0) | 0;
  424. };
  425. /**
  426. * Duplicates a Color.
  427. *
  428. * @param {Color} color The Color to duplicate.
  429. * @param {Color} [result] The object to store the result in, if undefined a new instance will be created.
  430. * @returns {Color} The modified result parameter or a new instance if result was undefined. (Returns undefined if color is undefined)
  431. */
  432. Color.clone = function(color, result) {
  433. if (!defined.defined(color)) {
  434. return undefined;
  435. }
  436. if (!defined.defined(result)) {
  437. return new Color(color.red, color.green, color.blue, color.alpha);
  438. }
  439. result.red = color.red;
  440. result.green = color.green;
  441. result.blue = color.blue;
  442. result.alpha = color.alpha;
  443. return result;
  444. };
  445. /**
  446. * Returns true if the first Color equals the second color.
  447. *
  448. * @param {Color} left The first Color to compare for equality.
  449. * @param {Color} right The second Color to compare for equality.
  450. * @returns {Boolean} <code>true</code> if the Colors are equal; otherwise, <code>false</code>.
  451. */
  452. Color.equals = function(left, right) {
  453. return (left === right) || //
  454. (defined.defined(left) && //
  455. defined.defined(right) && //
  456. left.red === right.red && //
  457. left.green === right.green && //
  458. left.blue === right.blue && //
  459. left.alpha === right.alpha);
  460. };
  461. /**
  462. * @private
  463. */
  464. Color.equalsArray = function(color, array, offset) {
  465. return color.red === array[offset] &&
  466. color.green === array[offset + 1] &&
  467. color.blue === array[offset + 2] &&
  468. color.alpha === array[offset + 3];
  469. };
  470. /**
  471. * Returns a duplicate of a Color instance.
  472. *
  473. * @param {Color} [result] The object to store the result in, if undefined a new instance will be created.
  474. * @returns {Color} The modified result parameter or a new instance if result was undefined.
  475. */
  476. Color.prototype.clone = function(result) {
  477. return Color.clone(this, result);
  478. };
  479. /**
  480. * Returns true if this Color equals other.
  481. *
  482. * @param {Color} other The Color to compare for equality.
  483. * @returns {Boolean} <code>true</code> if the Colors are equal; otherwise, <code>false</code>.
  484. */
  485. Color.prototype.equals = function(other) {
  486. return Color.equals(this, other);
  487. };
  488. /**
  489. * Returns <code>true</code> if this Color equals other componentwise within the specified epsilon.
  490. *
  491. * @param {Color} other The Color to compare for equality.
  492. * @param {Number} [epsilon=0.0] The epsilon to use for equality testing.
  493. * @returns {Boolean} <code>true</code> if the Colors are equal within the specified epsilon; otherwise, <code>false</code>.
  494. */
  495. Color.prototype.equalsEpsilon = function(other, epsilon) {
  496. return (this === other) || //
  497. ((defined.defined(other)) && //
  498. (Math.abs(this.red - other.red) <= epsilon) && //
  499. (Math.abs(this.green - other.green) <= epsilon) && //
  500. (Math.abs(this.blue - other.blue) <= epsilon) && //
  501. (Math.abs(this.alpha - other.alpha) <= epsilon));
  502. };
  503. /**
  504. * Creates a string representing this Color in the format '(red, green, blue, alpha)'.
  505. *
  506. * @returns {String} A string representing this Color in the format '(red, green, blue, alpha)'.
  507. */
  508. Color.prototype.toString = function() {
  509. return '(' + this.red + ', ' + this.green + ', ' + this.blue + ', ' + this.alpha + ')';
  510. };
  511. /**
  512. * Creates a string containing the CSS color value for this color.
  513. *
  514. * @returns {String} The CSS equivalent of this color.
  515. *
  516. * @see {@link http://www.w3.org/TR/css3-color/#rgba-color|CSS RGB or RGBA color values}
  517. */
  518. Color.prototype.toCssColorString = function() {
  519. var red = Color.floatToByte(this.red);
  520. var green = Color.floatToByte(this.green);
  521. var blue = Color.floatToByte(this.blue);
  522. if (this.alpha === 1) {
  523. return 'rgb(' + red + ',' + green + ',' + blue + ')';
  524. }
  525. return 'rgba(' + red + ',' + green + ',' + blue + ',' + this.alpha + ')';
  526. };
  527. /**
  528. * Converts this color to an array of red, green, blue, and alpha values
  529. * that are in the range of 0 to 255.
  530. *
  531. * @param {Number[]} [result] The array to store the result in, if undefined a new instance will be created.
  532. * @returns {Number[]} The modified result parameter or a new instance if result was undefined.
  533. */
  534. Color.prototype.toBytes = function(result) {
  535. var red = Color.floatToByte(this.red);
  536. var green = Color.floatToByte(this.green);
  537. var blue = Color.floatToByte(this.blue);
  538. var alpha = Color.floatToByte(this.alpha);
  539. if (!defined.defined(result)) {
  540. return [red, green, blue, alpha];
  541. }
  542. result[0] = red;
  543. result[1] = green;
  544. result[2] = blue;
  545. result[3] = alpha;
  546. return result;
  547. };
  548. /**
  549. * Converts this color to a single numeric unsigned 32-bit RGBA value, using the endianness
  550. * of the system.
  551. *
  552. * @returns {Number} A single numeric unsigned 32-bit RGBA value.
  553. *
  554. *
  555. * @example
  556. * var rgba = Cesium.Color.BLUE.toRgba();
  557. *
  558. * @see Color.fromRgba
  559. */
  560. Color.prototype.toRgba = function() {
  561. // scratchUint32Array and scratchUint8Array share an underlying array buffer
  562. scratchUint8Array[0] = Color.floatToByte(this.red);
  563. scratchUint8Array[1] = Color.floatToByte(this.green);
  564. scratchUint8Array[2] = Color.floatToByte(this.blue);
  565. scratchUint8Array[3] = Color.floatToByte(this.alpha);
  566. return scratchUint32Array[0];
  567. };
  568. /**
  569. * Brightens this color by the provided magnitude.
  570. *
  571. * @param {Number} magnitude A positive number indicating the amount to brighten.
  572. * @param {Color} result The object onto which to store the result.
  573. * @returns {Color} The modified result parameter.
  574. *
  575. * @example
  576. * var brightBlue = Cesium.Color.BLUE.brighten(0.5, new Cesium.Color());
  577. */
  578. Color.prototype.brighten = function(magnitude, result) {
  579. //>>includeStart('debug', pragmas.debug);
  580. Check.Check.typeOf.number('magnitude', magnitude);
  581. Check.Check.typeOf.number.greaterThanOrEquals('magnitude', magnitude, 0.0);
  582. Check.Check.typeOf.object('result', result);
  583. //>>includeEnd('debug');
  584. magnitude = (1.0 - magnitude);
  585. result.red = 1.0 - ((1.0 - this.red) * magnitude);
  586. result.green = 1.0 - ((1.0 - this.green) * magnitude);
  587. result.blue = 1.0 - ((1.0 - this.blue) * magnitude);
  588. result.alpha = this.alpha;
  589. return result;
  590. };
  591. /**
  592. * Darkens this color by the provided magnitude.
  593. *
  594. * @param {Number} magnitude A positive number indicating the amount to darken.
  595. * @param {Color} result The object onto which to store the result.
  596. * @returns {Color} The modified result parameter.
  597. *
  598. * @example
  599. * var darkBlue = Cesium.Color.BLUE.darken(0.5, new Cesium.Color());
  600. */
  601. Color.prototype.darken = function(magnitude, result) {
  602. //>>includeStart('debug', pragmas.debug);
  603. Check.Check.typeOf.number('magnitude', magnitude);
  604. Check.Check.typeOf.number.greaterThanOrEquals('magnitude', magnitude, 0.0);
  605. Check.Check.typeOf.object('result', result);
  606. //>>includeEnd('debug');
  607. magnitude = (1.0 - magnitude);
  608. result.red = this.red * magnitude;
  609. result.green = this.green * magnitude;
  610. result.blue = this.blue * magnitude;
  611. result.alpha = this.alpha;
  612. return result;
  613. };
  614. /**
  615. * Creates a new Color that has the same red, green, and blue components
  616. * as this Color, but with the specified alpha value.
  617. *
  618. * @param {Number} alpha The new alpha component.
  619. * @param {Color} [result] The object onto which to store the result.
  620. * @returns {Color} The modified result parameter or a new Color instance if one was not provided.
  621. *
  622. * @example var translucentRed = Cesium.Color.RED.withAlpha(0.9);
  623. */
  624. Color.prototype.withAlpha = function(alpha, result) {
  625. return Color.fromAlpha(this, alpha, result);
  626. };
  627. /**
  628. * Computes the componentwise sum of two Colors.
  629. *
  630. * @param {Color} left The first Color.
  631. * @param {Color} right The second Color.
  632. * @param {Color} result The object onto which to store the result.
  633. * @returns {Color} The modified result parameter.
  634. */
  635. Color.add = function(left, right, result) {
  636. //>>includeStart('debug', pragmas.debug);
  637. Check.Check.typeOf.object('left', left);
  638. Check.Check.typeOf.object('right', right);
  639. Check.Check.typeOf.object('result', result);
  640. //>>includeEnd('debug');
  641. result.red = left.red + right.red;
  642. result.green = left.green + right.green;
  643. result.blue = left.blue + right.blue;
  644. result.alpha = left.alpha + right.alpha;
  645. return result;
  646. };
  647. /**
  648. * Computes the componentwise difference of two Colors.
  649. *
  650. * @param {Color} left The first Color.
  651. * @param {Color} right The second Color.
  652. * @param {Color} result The object onto which to store the result.
  653. * @returns {Color} The modified result parameter.
  654. */
  655. Color.subtract = function(left, right, result) {
  656. //>>includeStart('debug', pragmas.debug);
  657. Check.Check.typeOf.object('left', left);
  658. Check.Check.typeOf.object('right', right);
  659. Check.Check.typeOf.object('result', result);
  660. //>>includeEnd('debug');
  661. result.red = left.red - right.red;
  662. result.green = left.green - right.green;
  663. result.blue = left.blue - right.blue;
  664. result.alpha = left.alpha - right.alpha;
  665. return result;
  666. };
  667. /**
  668. * Computes the componentwise product of two Colors.
  669. *
  670. * @param {Color} left The first Color.
  671. * @param {Color} right The second Color.
  672. * @param {Color} result The object onto which to store the result.
  673. * @returns {Color} The modified result parameter.
  674. */
  675. Color.multiply = function(left, right, result) {
  676. //>>includeStart('debug', pragmas.debug);
  677. Check.Check.typeOf.object('left', left);
  678. Check.Check.typeOf.object('right', right);
  679. Check.Check.typeOf.object('result', result);
  680. //>>includeEnd('debug');
  681. result.red = left.red * right.red;
  682. result.green = left.green * right.green;
  683. result.blue = left.blue * right.blue;
  684. result.alpha = left.alpha * right.alpha;
  685. return result;
  686. };
  687. /**
  688. * Computes the componentwise quotient of two Colors.
  689. *
  690. * @param {Color} left The first Color.
  691. * @param {Color} right The second Color.
  692. * @param {Color} result The object onto which to store the result.
  693. * @returns {Color} The modified result parameter.
  694. */
  695. Color.divide = function(left, right, result) {
  696. //>>includeStart('debug', pragmas.debug);
  697. Check.Check.typeOf.object('left', left);
  698. Check.Check.typeOf.object('right', right);
  699. Check.Check.typeOf.object('result', result);
  700. //>>includeEnd('debug');
  701. result.red = left.red / right.red;
  702. result.green = left.green / right.green;
  703. result.blue = left.blue / right.blue;
  704. result.alpha = left.alpha / right.alpha;
  705. return result;
  706. };
  707. /**
  708. * Computes the componentwise modulus of two Colors.
  709. *
  710. * @param {Color} left The first Color.
  711. * @param {Color} right The second Color.
  712. * @param {Color} result The object onto which to store the result.
  713. * @returns {Color} The modified result parameter.
  714. */
  715. Color.mod = function(left, right, result) {
  716. //>>includeStart('debug', pragmas.debug);
  717. Check.Check.typeOf.object('left', left);
  718. Check.Check.typeOf.object('right', right);
  719. Check.Check.typeOf.object('result', result);
  720. //>>includeEnd('debug');
  721. result.red = left.red % right.red;
  722. result.green = left.green % right.green;
  723. result.blue = left.blue % right.blue;
  724. result.alpha = left.alpha % right.alpha;
  725. return result;
  726. };
  727. /**
  728. * Multiplies the provided Color componentwise by the provided scalar.
  729. *
  730. * @param {Color} color The Color to be scaled.
  731. * @param {Number} scalar The scalar to multiply with.
  732. * @param {Color} result The object onto which to store the result.
  733. * @returns {Color} The modified result parameter.
  734. */
  735. Color.multiplyByScalar = function(color, scalar, result) {
  736. //>>includeStart('debug', pragmas.debug);
  737. Check.Check.typeOf.object('color', color);
  738. Check.Check.typeOf.number('scalar', scalar);
  739. Check.Check.typeOf.object('result', result);
  740. //>>includeEnd('debug');
  741. result.red = color.red * scalar;
  742. result.green = color.green * scalar;
  743. result.blue = color.blue * scalar;
  744. result.alpha = color.alpha * scalar;
  745. return result;
  746. };
  747. /**
  748. * Divides the provided Color componentwise by the provided scalar.
  749. *
  750. * @param {Color} color The Color to be divided.
  751. * @param {Number} scalar The scalar to divide with.
  752. * @param {Color} result The object onto which to store the result.
  753. * @returns {Color} The modified result parameter.
  754. */
  755. Color.divideByScalar = function(color, scalar, result) {
  756. //>>includeStart('debug', pragmas.debug);
  757. Check.Check.typeOf.object('color', color);
  758. Check.Check.typeOf.number('scalar', scalar);
  759. Check.Check.typeOf.object('result', result);
  760. //>>includeEnd('debug');
  761. result.red = color.red / scalar;
  762. result.green = color.green / scalar;
  763. result.blue = color.blue / scalar;
  764. result.alpha = color.alpha / scalar;
  765. return result;
  766. };
  767. /**
  768. * An immutable Color instance initialized to CSS color #F0F8FF
  769. * <span class="colorSwath" style="background: #F0F8FF;"></span>
  770. *
  771. * @constant
  772. * @type {Color}
  773. */
  774. Color.ALICEBLUE = freezeObject.freezeObject(Color.fromCssColorString('#F0F8FF'));
  775. /**
  776. * An immutable Color instance initialized to CSS color #FAEBD7
  777. * <span class="colorSwath" style="background: #FAEBD7;"></span>
  778. *
  779. * @constant
  780. * @type {Color}
  781. */
  782. Color.ANTIQUEWHITE = freezeObject.freezeObject(Color.fromCssColorString('#FAEBD7'));
  783. /**
  784. * An immutable Color instance initialized to CSS color #00FFFF
  785. * <span class="colorSwath" style="background: #00FFFF;"></span>
  786. *
  787. * @constant
  788. * @type {Color}
  789. */
  790. Color.AQUA = freezeObject.freezeObject(Color.fromCssColorString('#00FFFF'));
  791. /**
  792. * An immutable Color instance initialized to CSS color #7FFFD4
  793. * <span class="colorSwath" style="background: #7FFFD4;"></span>
  794. *
  795. * @constant
  796. * @type {Color}
  797. */
  798. Color.AQUAMARINE = freezeObject.freezeObject(Color.fromCssColorString('#7FFFD4'));
  799. /**
  800. * An immutable Color instance initialized to CSS color #F0FFFF
  801. * <span class="colorSwath" style="background: #F0FFFF;"></span>
  802. *
  803. * @constant
  804. * @type {Color}
  805. */
  806. Color.AZURE = freezeObject.freezeObject(Color.fromCssColorString('#F0FFFF'));
  807. /**
  808. * An immutable Color instance initialized to CSS color #F5F5DC
  809. * <span class="colorSwath" style="background: #F5F5DC;"></span>
  810. *
  811. * @constant
  812. * @type {Color}
  813. */
  814. Color.BEIGE = freezeObject.freezeObject(Color.fromCssColorString('#F5F5DC'));
  815. /**
  816. * An immutable Color instance initialized to CSS color #FFE4C4
  817. * <span class="colorSwath" style="background: #FFE4C4;"></span>
  818. *
  819. * @constant
  820. * @type {Color}
  821. */
  822. Color.BISQUE = freezeObject.freezeObject(Color.fromCssColorString('#FFE4C4'));
  823. /**
  824. * An immutable Color instance initialized to CSS color #000000
  825. * <span class="colorSwath" style="background: #000000;"></span>
  826. *
  827. * @constant
  828. * @type {Color}
  829. */
  830. Color.BLACK = freezeObject.freezeObject(Color.fromCssColorString('#000000'));
  831. /**
  832. * An immutable Color instance initialized to CSS color #FFEBCD
  833. * <span class="colorSwath" style="background: #FFEBCD;"></span>
  834. *
  835. * @constant
  836. * @type {Color}
  837. */
  838. Color.BLANCHEDALMOND = freezeObject.freezeObject(Color.fromCssColorString('#FFEBCD'));
  839. /**
  840. * An immutable Color instance initialized to CSS color #0000FF
  841. * <span class="colorSwath" style="background: #0000FF;"></span>
  842. *
  843. * @constant
  844. * @type {Color}
  845. */
  846. Color.BLUE = freezeObject.freezeObject(Color.fromCssColorString('#0000FF'));
  847. /**
  848. * An immutable Color instance initialized to CSS color #8A2BE2
  849. * <span class="colorSwath" style="background: #8A2BE2;"></span>
  850. *
  851. * @constant
  852. * @type {Color}
  853. */
  854. Color.BLUEVIOLET = freezeObject.freezeObject(Color.fromCssColorString('#8A2BE2'));
  855. /**
  856. * An immutable Color instance initialized to CSS color #A52A2A
  857. * <span class="colorSwath" style="background: #A52A2A;"></span>
  858. *
  859. * @constant
  860. * @type {Color}
  861. */
  862. Color.BROWN = freezeObject.freezeObject(Color.fromCssColorString('#A52A2A'));
  863. /**
  864. * An immutable Color instance initialized to CSS color #DEB887
  865. * <span class="colorSwath" style="background: #DEB887;"></span>
  866. *
  867. * @constant
  868. * @type {Color}
  869. */
  870. Color.BURLYWOOD = freezeObject.freezeObject(Color.fromCssColorString('#DEB887'));
  871. /**
  872. * An immutable Color instance initialized to CSS color #5F9EA0
  873. * <span class="colorSwath" style="background: #5F9EA0;"></span>
  874. *
  875. * @constant
  876. * @type {Color}
  877. */
  878. Color.CADETBLUE = freezeObject.freezeObject(Color.fromCssColorString('#5F9EA0'));
  879. /**
  880. * An immutable Color instance initialized to CSS color #7FFF00
  881. * <span class="colorSwath" style="background: #7FFF00;"></span>
  882. *
  883. * @constant
  884. * @type {Color}
  885. */
  886. Color.CHARTREUSE = freezeObject.freezeObject(Color.fromCssColorString('#7FFF00'));
  887. /**
  888. * An immutable Color instance initialized to CSS color #D2691E
  889. * <span class="colorSwath" style="background: #D2691E;"></span>
  890. *
  891. * @constant
  892. * @type {Color}
  893. */
  894. Color.CHOCOLATE = freezeObject.freezeObject(Color.fromCssColorString('#D2691E'));
  895. /**
  896. * An immutable Color instance initialized to CSS color #FF7F50
  897. * <span class="colorSwath" style="background: #FF7F50;"></span>
  898. *
  899. * @constant
  900. * @type {Color}
  901. */
  902. Color.CORAL = freezeObject.freezeObject(Color.fromCssColorString('#FF7F50'));
  903. /**
  904. * An immutable Color instance initialized to CSS color #6495ED
  905. * <span class="colorSwath" style="background: #6495ED;"></span>
  906. *
  907. * @constant
  908. * @type {Color}
  909. */
  910. Color.CORNFLOWERBLUE = freezeObject.freezeObject(Color.fromCssColorString('#6495ED'));
  911. /**
  912. * An immutable Color instance initialized to CSS color #FFF8DC
  913. * <span class="colorSwath" style="background: #FFF8DC;"></span>
  914. *
  915. * @constant
  916. * @type {Color}
  917. */
  918. Color.CORNSILK = freezeObject.freezeObject(Color.fromCssColorString('#FFF8DC'));
  919. /**
  920. * An immutable Color instance initialized to CSS color #DC143C
  921. * <span class="colorSwath" style="background: #DC143C;"></span>
  922. *
  923. * @constant
  924. * @type {Color}
  925. */
  926. Color.CRIMSON = freezeObject.freezeObject(Color.fromCssColorString('#DC143C'));
  927. /**
  928. * An immutable Color instance initialized to CSS color #00FFFF
  929. * <span class="colorSwath" style="background: #00FFFF;"></span>
  930. *
  931. * @constant
  932. * @type {Color}
  933. */
  934. Color.CYAN = freezeObject.freezeObject(Color.fromCssColorString('#00FFFF'));
  935. /**
  936. * An immutable Color instance initialized to CSS color #00008B
  937. * <span class="colorSwath" style="background: #00008B;"></span>
  938. *
  939. * @constant
  940. * @type {Color}
  941. */
  942. Color.DARKBLUE = freezeObject.freezeObject(Color.fromCssColorString('#00008B'));
  943. /**
  944. * An immutable Color instance initialized to CSS color #008B8B
  945. * <span class="colorSwath" style="background: #008B8B;"></span>
  946. *
  947. * @constant
  948. * @type {Color}
  949. */
  950. Color.DARKCYAN = freezeObject.freezeObject(Color.fromCssColorString('#008B8B'));
  951. /**
  952. * An immutable Color instance initialized to CSS color #B8860B
  953. * <span class="colorSwath" style="background: #B8860B;"></span>
  954. *
  955. * @constant
  956. * @type {Color}
  957. */
  958. Color.DARKGOLDENROD = freezeObject.freezeObject(Color.fromCssColorString('#B8860B'));
  959. /**
  960. * An immutable Color instance initialized to CSS color #A9A9A9
  961. * <span class="colorSwath" style="background: #A9A9A9;"></span>
  962. *
  963. * @constant
  964. * @type {Color}
  965. */
  966. Color.DARKGRAY = freezeObject.freezeObject(Color.fromCssColorString('#A9A9A9'));
  967. /**
  968. * An immutable Color instance initialized to CSS color #006400
  969. * <span class="colorSwath" style="background: #006400;"></span>
  970. *
  971. * @constant
  972. * @type {Color}
  973. */
  974. Color.DARKGREEN = freezeObject.freezeObject(Color.fromCssColorString('#006400'));
  975. /**
  976. * An immutable Color instance initialized to CSS color #A9A9A9
  977. * <span class="colorSwath" style="background: #A9A9A9;"></span>
  978. *
  979. * @constant
  980. * @type {Color}
  981. */
  982. Color.DARKGREY = Color.DARKGRAY;
  983. /**
  984. * An immutable Color instance initialized to CSS color #BDB76B
  985. * <span class="colorSwath" style="background: #BDB76B;"></span>
  986. *
  987. * @constant
  988. * @type {Color}
  989. */
  990. Color.DARKKHAKI = freezeObject.freezeObject(Color.fromCssColorString('#BDB76B'));
  991. /**
  992. * An immutable Color instance initialized to CSS color #8B008B
  993. * <span class="colorSwath" style="background: #8B008B;"></span>
  994. *
  995. * @constant
  996. * @type {Color}
  997. */
  998. Color.DARKMAGENTA = freezeObject.freezeObject(Color.fromCssColorString('#8B008B'));
  999. /**
  1000. * An immutable Color instance initialized to CSS color #556B2F
  1001. * <span class="colorSwath" style="background: #556B2F;"></span>
  1002. *
  1003. * @constant
  1004. * @type {Color}
  1005. */
  1006. Color.DARKOLIVEGREEN = freezeObject.freezeObject(Color.fromCssColorString('#556B2F'));
  1007. /**
  1008. * An immutable Color instance initialized to CSS color #FF8C00
  1009. * <span class="colorSwath" style="background: #FF8C00;"></span>
  1010. *
  1011. * @constant
  1012. * @type {Color}
  1013. */
  1014. Color.DARKORANGE = freezeObject.freezeObject(Color.fromCssColorString('#FF8C00'));
  1015. /**
  1016. * An immutable Color instance initialized to CSS color #9932CC
  1017. * <span class="colorSwath" style="background: #9932CC;"></span>
  1018. *
  1019. * @constant
  1020. * @type {Color}
  1021. */
  1022. Color.DARKORCHID = freezeObject.freezeObject(Color.fromCssColorString('#9932CC'));
  1023. /**
  1024. * An immutable Color instance initialized to CSS color #8B0000
  1025. * <span class="colorSwath" style="background: #8B0000;"></span>
  1026. *
  1027. * @constant
  1028. * @type {Color}
  1029. */
  1030. Color.DARKRED = freezeObject.freezeObject(Color.fromCssColorString('#8B0000'));
  1031. /**
  1032. * An immutable Color instance initialized to CSS color #E9967A
  1033. * <span class="colorSwath" style="background: #E9967A;"></span>
  1034. *
  1035. * @constant
  1036. * @type {Color}
  1037. */
  1038. Color.DARKSALMON = freezeObject.freezeObject(Color.fromCssColorString('#E9967A'));
  1039. /**
  1040. * An immutable Color instance initialized to CSS color #8FBC8F
  1041. * <span class="colorSwath" style="background: #8FBC8F;"></span>
  1042. *
  1043. * @constant
  1044. * @type {Color}
  1045. */
  1046. Color.DARKSEAGREEN = freezeObject.freezeObject(Color.fromCssColorString('#8FBC8F'));
  1047. /**
  1048. * An immutable Color instance initialized to CSS color #483D8B
  1049. * <span class="colorSwath" style="background: #483D8B;"></span>
  1050. *
  1051. * @constant
  1052. * @type {Color}
  1053. */
  1054. Color.DARKSLATEBLUE = freezeObject.freezeObject(Color.fromCssColorString('#483D8B'));
  1055. /**
  1056. * An immutable Color instance initialized to CSS color #2F4F4F
  1057. * <span class="colorSwath" style="background: #2F4F4F;"></span>
  1058. *
  1059. * @constant
  1060. * @type {Color}
  1061. */
  1062. Color.DARKSLATEGRAY = freezeObject.freezeObject(Color.fromCssColorString('#2F4F4F'));
  1063. /**
  1064. * An immutable Color instance initialized to CSS color #2F4F4F
  1065. * <span class="colorSwath" style="background: #2F4F4F;"></span>
  1066. *
  1067. * @constant
  1068. * @type {Color}
  1069. */
  1070. Color.DARKSLATEGREY = Color.DARKSLATEGRAY;
  1071. /**
  1072. * An immutable Color instance initialized to CSS color #00CED1
  1073. * <span class="colorSwath" style="background: #00CED1;"></span>
  1074. *
  1075. * @constant
  1076. * @type {Color}
  1077. */
  1078. Color.DARKTURQUOISE = freezeObject.freezeObject(Color.fromCssColorString('#00CED1'));
  1079. /**
  1080. * An immutable Color instance initialized to CSS color #9400D3
  1081. * <span class="colorSwath" style="background: #9400D3;"></span>
  1082. *
  1083. * @constant
  1084. * @type {Color}
  1085. */
  1086. Color.DARKVIOLET = freezeObject.freezeObject(Color.fromCssColorString('#9400D3'));
  1087. /**
  1088. * An immutable Color instance initialized to CSS color #FF1493
  1089. * <span class="colorSwath" style="background: #FF1493;"></span>
  1090. *
  1091. * @constant
  1092. * @type {Color}
  1093. */
  1094. Color.DEEPPINK = freezeObject.freezeObject(Color.fromCssColorString('#FF1493'));
  1095. /**
  1096. * An immutable Color instance initialized to CSS color #00BFFF
  1097. * <span class="colorSwath" style="background: #00BFFF;"></span>
  1098. *
  1099. * @constant
  1100. * @type {Color}
  1101. */
  1102. Color.DEEPSKYBLUE = freezeObject.freezeObject(Color.fromCssColorString('#00BFFF'));
  1103. /**
  1104. * An immutable Color instance initialized to CSS color #696969
  1105. * <span class="colorSwath" style="background: #696969;"></span>
  1106. *
  1107. * @constant
  1108. * @type {Color}
  1109. */
  1110. Color.DIMGRAY = freezeObject.freezeObject(Color.fromCssColorString('#696969'));
  1111. /**
  1112. * An immutable Color instance initialized to CSS color #696969
  1113. * <span class="colorSwath" style="background: #696969;"></span>
  1114. *
  1115. * @constant
  1116. * @type {Color}
  1117. */
  1118. Color.DIMGREY = Color.DIMGRAY;
  1119. /**
  1120. * An immutable Color instance initialized to CSS color #1E90FF
  1121. * <span class="colorSwath" style="background: #1E90FF;"></span>
  1122. *
  1123. * @constant
  1124. * @type {Color}
  1125. */
  1126. Color.DODGERBLUE = freezeObject.freezeObject(Color.fromCssColorString('#1E90FF'));
  1127. /**
  1128. * An immutable Color instance initialized to CSS color #B22222
  1129. * <span class="colorSwath" style="background: #B22222;"></span>
  1130. *
  1131. * @constant
  1132. * @type {Color}
  1133. */
  1134. Color.FIREBRICK = freezeObject.freezeObject(Color.fromCssColorString('#B22222'));
  1135. /**
  1136. * An immutable Color instance initialized to CSS color #FFFAF0
  1137. * <span class="colorSwath" style="background: #FFFAF0;"></span>
  1138. *
  1139. * @constant
  1140. * @type {Color}
  1141. */
  1142. Color.FLORALWHITE = freezeObject.freezeObject(Color.fromCssColorString('#FFFAF0'));
  1143. /**
  1144. * An immutable Color instance initialized to CSS color #228B22
  1145. * <span class="colorSwath" style="background: #228B22;"></span>
  1146. *
  1147. * @constant
  1148. * @type {Color}
  1149. */
  1150. Color.FORESTGREEN = freezeObject.freezeObject(Color.fromCssColorString('#228B22'));
  1151. /**
  1152. * An immutable Color instance initialized to CSS color #FF00FF
  1153. * <span class="colorSwath" style="background: #FF00FF;"></span>
  1154. *
  1155. * @constant
  1156. * @type {Color}
  1157. */
  1158. Color.FUCHSIA = freezeObject.freezeObject(Color.fromCssColorString('#FF00FF'));
  1159. /**
  1160. * An immutable Color instance initialized to CSS color #DCDCDC
  1161. * <span class="colorSwath" style="background: #DCDCDC;"></span>
  1162. *
  1163. * @constant
  1164. * @type {Color}
  1165. */
  1166. Color.GAINSBORO = freezeObject.freezeObject(Color.fromCssColorString('#DCDCDC'));
  1167. /**
  1168. * An immutable Color instance initialized to CSS color #F8F8FF
  1169. * <span class="colorSwath" style="background: #F8F8FF;"></span>
  1170. *
  1171. * @constant
  1172. * @type {Color}
  1173. */
  1174. Color.GHOSTWHITE = freezeObject.freezeObject(Color.fromCssColorString('#F8F8FF'));
  1175. /**
  1176. * An immutable Color instance initialized to CSS color #FFD700
  1177. * <span class="colorSwath" style="background: #FFD700;"></span>
  1178. *
  1179. * @constant
  1180. * @type {Color}
  1181. */
  1182. Color.GOLD = freezeObject.freezeObject(Color.fromCssColorString('#FFD700'));
  1183. /**
  1184. * An immutable Color instance initialized to CSS color #DAA520
  1185. * <span class="colorSwath" style="background: #DAA520;"></span>
  1186. *
  1187. * @constant
  1188. * @type {Color}
  1189. */
  1190. Color.GOLDENROD = freezeObject.freezeObject(Color.fromCssColorString('#DAA520'));
  1191. /**
  1192. * An immutable Color instance initialized to CSS color #808080
  1193. * <span class="colorSwath" style="background: #808080;"></span>
  1194. *
  1195. * @constant
  1196. * @type {Color}
  1197. */
  1198. Color.GRAY = freezeObject.freezeObject(Color.fromCssColorString('#808080'));
  1199. /**
  1200. * An immutable Color instance initialized to CSS color #008000
  1201. * <span class="colorSwath" style="background: #008000;"></span>
  1202. *
  1203. * @constant
  1204. * @type {Color}
  1205. */
  1206. Color.GREEN = freezeObject.freezeObject(Color.fromCssColorString('#008000'));
  1207. /**
  1208. * An immutable Color instance initialized to CSS color #ADFF2F
  1209. * <span class="colorSwath" style="background: #ADFF2F;"></span>
  1210. *
  1211. * @constant
  1212. * @type {Color}
  1213. */
  1214. Color.GREENYELLOW = freezeObject.freezeObject(Color.fromCssColorString('#ADFF2F'));
  1215. /**
  1216. * An immutable Color instance initialized to CSS color #808080
  1217. * <span class="colorSwath" style="background: #808080;"></span>
  1218. *
  1219. * @constant
  1220. * @type {Color}
  1221. */
  1222. Color.GREY = Color.GRAY;
  1223. /**
  1224. * An immutable Color instance initialized to CSS color #F0FFF0
  1225. * <span class="colorSwath" style="background: #F0FFF0;"></span>
  1226. *
  1227. * @constant
  1228. * @type {Color}
  1229. */
  1230. Color.HONEYDEW = freezeObject.freezeObject(Color.fromCssColorString('#F0FFF0'));
  1231. /**
  1232. * An immutable Color instance initialized to CSS color #FF69B4
  1233. * <span class="colorSwath" style="background: #FF69B4;"></span>
  1234. *
  1235. * @constant
  1236. * @type {Color}
  1237. */
  1238. Color.HOTPINK = freezeObject.freezeObject(Color.fromCssColorString('#FF69B4'));
  1239. /**
  1240. * An immutable Color instance initialized to CSS color #CD5C5C
  1241. * <span class="colorSwath" style="background: #CD5C5C;"></span>
  1242. *
  1243. * @constant
  1244. * @type {Color}
  1245. */
  1246. Color.INDIANRED = freezeObject.freezeObject(Color.fromCssColorString('#CD5C5C'));
  1247. /**
  1248. * An immutable Color instance initialized to CSS color #4B0082
  1249. * <span class="colorSwath" style="background: #4B0082;"></span>
  1250. *
  1251. * @constant
  1252. * @type {Color}
  1253. */
  1254. Color.INDIGO = freezeObject.freezeObject(Color.fromCssColorString('#4B0082'));
  1255. /**
  1256. * An immutable Color instance initialized to CSS color #FFFFF0
  1257. * <span class="colorSwath" style="background: #FFFFF0;"></span>
  1258. *
  1259. * @constant
  1260. * @type {Color}
  1261. */
  1262. Color.IVORY = freezeObject.freezeObject(Color.fromCssColorString('#FFFFF0'));
  1263. /**
  1264. * An immutable Color instance initialized to CSS color #F0E68C
  1265. * <span class="colorSwath" style="background: #F0E68C;"></span>
  1266. *
  1267. * @constant
  1268. * @type {Color}
  1269. */
  1270. Color.KHAKI = freezeObject.freezeObject(Color.fromCssColorString('#F0E68C'));
  1271. /**
  1272. * An immutable Color instance initialized to CSS color #E6E6FA
  1273. * <span class="colorSwath" style="background: #E6E6FA;"></span>
  1274. *
  1275. * @constant
  1276. * @type {Color}
  1277. */
  1278. Color.LAVENDER = freezeObject.freezeObject(Color.fromCssColorString('#E6E6FA'));
  1279. /**
  1280. * An immutable Color instance initialized to CSS color #FFF0F5
  1281. * <span class="colorSwath" style="background: #FFF0F5;"></span>
  1282. *
  1283. * @constant
  1284. * @type {Color}
  1285. */
  1286. Color.LAVENDAR_BLUSH = freezeObject.freezeObject(Color.fromCssColorString('#FFF0F5'));
  1287. /**
  1288. * An immutable Color instance initialized to CSS color #7CFC00
  1289. * <span class="colorSwath" style="background: #7CFC00;"></span>
  1290. *
  1291. * @constant
  1292. * @type {Color}
  1293. */
  1294. Color.LAWNGREEN = freezeObject.freezeObject(Color.fromCssColorString('#7CFC00'));
  1295. /**
  1296. * An immutable Color instance initialized to CSS color #FFFACD
  1297. * <span class="colorSwath" style="background: #FFFACD;"></span>
  1298. *
  1299. * @constant
  1300. * @type {Color}
  1301. */
  1302. Color.LEMONCHIFFON = freezeObject.freezeObject(Color.fromCssColorString('#FFFACD'));
  1303. /**
  1304. * An immutable Color instance initialized to CSS color #ADD8E6
  1305. * <span class="colorSwath" style="background: #ADD8E6;"></span>
  1306. *
  1307. * @constant
  1308. * @type {Color}
  1309. */
  1310. Color.LIGHTBLUE = freezeObject.freezeObject(Color.fromCssColorString('#ADD8E6'));
  1311. /**
  1312. * An immutable Color instance initialized to CSS color #F08080
  1313. * <span class="colorSwath" style="background: #F08080;"></span>
  1314. *
  1315. * @constant
  1316. * @type {Color}
  1317. */
  1318. Color.LIGHTCORAL = freezeObject.freezeObject(Color.fromCssColorString('#F08080'));
  1319. /**
  1320. * An immutable Color instance initialized to CSS color #E0FFFF
  1321. * <span class="colorSwath" style="background: #E0FFFF;"></span>
  1322. *
  1323. * @constant
  1324. * @type {Color}
  1325. */
  1326. Color.LIGHTCYAN = freezeObject.freezeObject(Color.fromCssColorString('#E0FFFF'));
  1327. /**
  1328. * An immutable Color instance initialized to CSS color #FAFAD2
  1329. * <span class="colorSwath" style="background: #FAFAD2;"></span>
  1330. *
  1331. * @constant
  1332. * @type {Color}
  1333. */
  1334. Color.LIGHTGOLDENRODYELLOW = freezeObject.freezeObject(Color.fromCssColorString('#FAFAD2'));
  1335. /**
  1336. * An immutable Color instance initialized to CSS color #D3D3D3
  1337. * <span class="colorSwath" style="background: #D3D3D3;"></span>
  1338. *
  1339. * @constant
  1340. * @type {Color}
  1341. */
  1342. Color.LIGHTGRAY = freezeObject.freezeObject(Color.fromCssColorString('#D3D3D3'));
  1343. /**
  1344. * An immutable Color instance initialized to CSS color #90EE90
  1345. * <span class="colorSwath" style="background: #90EE90;"></span>
  1346. *
  1347. * @constant
  1348. * @type {Color}
  1349. */
  1350. Color.LIGHTGREEN = freezeObject.freezeObject(Color.fromCssColorString('#90EE90'));
  1351. /**
  1352. * An immutable Color instance initialized to CSS color #D3D3D3
  1353. * <span class="colorSwath" style="background: #D3D3D3;"></span>
  1354. *
  1355. * @constant
  1356. * @type {Color}
  1357. */
  1358. Color.LIGHTGREY = Color.LIGHTGRAY;
  1359. /**
  1360. * An immutable Color instance initialized to CSS color #FFB6C1
  1361. * <span class="colorSwath" style="background: #FFB6C1;"></span>
  1362. *
  1363. * @constant
  1364. * @type {Color}
  1365. */
  1366. Color.LIGHTPINK = freezeObject.freezeObject(Color.fromCssColorString('#FFB6C1'));
  1367. /**
  1368. * An immutable Color instance initialized to CSS color #20B2AA
  1369. * <span class="colorSwath" style="background: #20B2AA;"></span>
  1370. *
  1371. * @constant
  1372. * @type {Color}
  1373. */
  1374. Color.LIGHTSEAGREEN = freezeObject.freezeObject(Color.fromCssColorString('#20B2AA'));
  1375. /**
  1376. * An immutable Color instance initialized to CSS color #87CEFA
  1377. * <span class="colorSwath" style="background: #87CEFA;"></span>
  1378. *
  1379. * @constant
  1380. * @type {Color}
  1381. */
  1382. Color.LIGHTSKYBLUE = freezeObject.freezeObject(Color.fromCssColorString('#87CEFA'));
  1383. /**
  1384. * An immutable Color instance initialized to CSS color #778899
  1385. * <span class="colorSwath" style="background: #778899;"></span>
  1386. *
  1387. * @constant
  1388. * @type {Color}
  1389. */
  1390. Color.LIGHTSLATEGRAY = freezeObject.freezeObject(Color.fromCssColorString('#778899'));
  1391. /**
  1392. * An immutable Color instance initialized to CSS color #778899
  1393. * <span class="colorSwath" style="background: #778899;"></span>
  1394. *
  1395. * @constant
  1396. * @type {Color}
  1397. */
  1398. Color.LIGHTSLATEGREY = Color.LIGHTSLATEGRAY;
  1399. /**
  1400. * An immutable Color instance initialized to CSS color #B0C4DE
  1401. * <span class="colorSwath" style="background: #B0C4DE;"></span>
  1402. *
  1403. * @constant
  1404. * @type {Color}
  1405. */
  1406. Color.LIGHTSTEELBLUE = freezeObject.freezeObject(Color.fromCssColorString('#B0C4DE'));
  1407. /**
  1408. * An immutable Color instance initialized to CSS color #FFFFE0
  1409. * <span class="colorSwath" style="background: #FFFFE0;"></span>
  1410. *
  1411. * @constant
  1412. * @type {Color}
  1413. */
  1414. Color.LIGHTYELLOW = freezeObject.freezeObject(Color.fromCssColorString('#FFFFE0'));
  1415. /**
  1416. * An immutable Color instance initialized to CSS color #00FF00
  1417. * <span class="colorSwath" style="background: #00FF00;"></span>
  1418. *
  1419. * @constant
  1420. * @type {Color}
  1421. */
  1422. Color.LIME = freezeObject.freezeObject(Color.fromCssColorString('#00FF00'));
  1423. /**
  1424. * An immutable Color instance initialized to CSS color #32CD32
  1425. * <span class="colorSwath" style="background: #32CD32;"></span>
  1426. *
  1427. * @constant
  1428. * @type {Color}
  1429. */
  1430. Color.LIMEGREEN = freezeObject.freezeObject(Color.fromCssColorString('#32CD32'));
  1431. /**
  1432. * An immutable Color instance initialized to CSS color #FAF0E6
  1433. * <span class="colorSwath" style="background: #FAF0E6;"></span>
  1434. *
  1435. * @constant
  1436. * @type {Color}
  1437. */
  1438. Color.LINEN = freezeObject.freezeObject(Color.fromCssColorString('#FAF0E6'));
  1439. /**
  1440. * An immutable Color instance initialized to CSS color #FF00FF
  1441. * <span class="colorSwath" style="background: #FF00FF;"></span>
  1442. *
  1443. * @constant
  1444. * @type {Color}
  1445. */
  1446. Color.MAGENTA = freezeObject.freezeObject(Color.fromCssColorString('#FF00FF'));
  1447. /**
  1448. * An immutable Color instance initialized to CSS color #800000
  1449. * <span class="colorSwath" style="background: #800000;"></span>
  1450. *
  1451. * @constant
  1452. * @type {Color}
  1453. */
  1454. Color.MAROON = freezeObject.freezeObject(Color.fromCssColorString('#800000'));
  1455. /**
  1456. * An immutable Color instance initialized to CSS color #66CDAA
  1457. * <span class="colorSwath" style="background: #66CDAA;"></span>
  1458. *
  1459. * @constant
  1460. * @type {Color}
  1461. */
  1462. Color.MEDIUMAQUAMARINE = freezeObject.freezeObject(Color.fromCssColorString('#66CDAA'));
  1463. /**
  1464. * An immutable Color instance initialized to CSS color #0000CD
  1465. * <span class="colorSwath" style="background: #0000CD;"></span>
  1466. *
  1467. * @constant
  1468. * @type {Color}
  1469. */
  1470. Color.MEDIUMBLUE = freezeObject.freezeObject(Color.fromCssColorString('#0000CD'));
  1471. /**
  1472. * An immutable Color instance initialized to CSS color #BA55D3
  1473. * <span class="colorSwath" style="background: #BA55D3;"></span>
  1474. *
  1475. * @constant
  1476. * @type {Color}
  1477. */
  1478. Color.MEDIUMORCHID = freezeObject.freezeObject(Color.fromCssColorString('#BA55D3'));
  1479. /**
  1480. * An immutable Color instance initialized to CSS color #9370DB
  1481. * <span class="colorSwath" style="background: #9370DB;"></span>
  1482. *
  1483. * @constant
  1484. * @type {Color}
  1485. */
  1486. Color.MEDIUMPURPLE = freezeObject.freezeObject(Color.fromCssColorString('#9370DB'));
  1487. /**
  1488. * An immutable Color instance initialized to CSS color #3CB371
  1489. * <span class="colorSwath" style="background: #3CB371;"></span>
  1490. *
  1491. * @constant
  1492. * @type {Color}
  1493. */
  1494. Color.MEDIUMSEAGREEN = freezeObject.freezeObject(Color.fromCssColorString('#3CB371'));
  1495. /**
  1496. * An immutable Color instance initialized to CSS color #7B68EE
  1497. * <span class="colorSwath" style="background: #7B68EE;"></span>
  1498. *
  1499. * @constant
  1500. * @type {Color}
  1501. */
  1502. Color.MEDIUMSLATEBLUE = freezeObject.freezeObject(Color.fromCssColorString('#7B68EE'));
  1503. /**
  1504. * An immutable Color instance initialized to CSS color #00FA9A
  1505. * <span class="colorSwath" style="background: #00FA9A;"></span>
  1506. *
  1507. * @constant
  1508. * @type {Color}
  1509. */
  1510. Color.MEDIUMSPRINGGREEN = freezeObject.freezeObject(Color.fromCssColorString('#00FA9A'));
  1511. /**
  1512. * An immutable Color instance initialized to CSS color #48D1CC
  1513. * <span class="colorSwath" style="background: #48D1CC;"></span>
  1514. *
  1515. * @constant
  1516. * @type {Color}
  1517. */
  1518. Color.MEDIUMTURQUOISE = freezeObject.freezeObject(Color.fromCssColorString('#48D1CC'));
  1519. /**
  1520. * An immutable Color instance initialized to CSS color #C71585
  1521. * <span class="colorSwath" style="background: #C71585;"></span>
  1522. *
  1523. * @constant
  1524. * @type {Color}
  1525. */
  1526. Color.MEDIUMVIOLETRED = freezeObject.freezeObject(Color.fromCssColorString('#C71585'));
  1527. /**
  1528. * An immutable Color instance initialized to CSS color #191970
  1529. * <span class="colorSwath" style="background: #191970;"></span>
  1530. *
  1531. * @constant
  1532. * @type {Color}
  1533. */
  1534. Color.MIDNIGHTBLUE = freezeObject.freezeObject(Color.fromCssColorString('#191970'));
  1535. /**
  1536. * An immutable Color instance initialized to CSS color #F5FFFA
  1537. * <span class="colorSwath" style="background: #F5FFFA;"></span>
  1538. *
  1539. * @constant
  1540. * @type {Color}
  1541. */
  1542. Color.MINTCREAM = freezeObject.freezeObject(Color.fromCssColorString('#F5FFFA'));
  1543. /**
  1544. * An immutable Color instance initialized to CSS color #FFE4E1
  1545. * <span class="colorSwath" style="background: #FFE4E1;"></span>
  1546. *
  1547. * @constant
  1548. * @type {Color}
  1549. */
  1550. Color.MISTYROSE = freezeObject.freezeObject(Color.fromCssColorString('#FFE4E1'));
  1551. /**
  1552. * An immutable Color instance initialized to CSS color #FFE4B5
  1553. * <span class="colorSwath" style="background: #FFE4B5;"></span>
  1554. *
  1555. * @constant
  1556. * @type {Color}
  1557. */
  1558. Color.MOCCASIN = freezeObject.freezeObject(Color.fromCssColorString('#FFE4B5'));
  1559. /**
  1560. * An immutable Color instance initialized to CSS color #FFDEAD
  1561. * <span class="colorSwath" style="background: #FFDEAD;"></span>
  1562. *
  1563. * @constant
  1564. * @type {Color}
  1565. */
  1566. Color.NAVAJOWHITE = freezeObject.freezeObject(Color.fromCssColorString('#FFDEAD'));
  1567. /**
  1568. * An immutable Color instance initialized to CSS color #000080
  1569. * <span class="colorSwath" style="background: #000080;"></span>
  1570. *
  1571. * @constant
  1572. * @type {Color}
  1573. */
  1574. Color.NAVY = freezeObject.freezeObject(Color.fromCssColorString('#000080'));
  1575. /**
  1576. * An immutable Color instance initialized to CSS color #FDF5E6
  1577. * <span class="colorSwath" style="background: #FDF5E6;"></span>
  1578. *
  1579. * @constant
  1580. * @type {Color}
  1581. */
  1582. Color.OLDLACE = freezeObject.freezeObject(Color.fromCssColorString('#FDF5E6'));
  1583. /**
  1584. * An immutable Color instance initialized to CSS color #808000
  1585. * <span class="colorSwath" style="background: #808000;"></span>
  1586. *
  1587. * @constant
  1588. * @type {Color}
  1589. */
  1590. Color.OLIVE = freezeObject.freezeObject(Color.fromCssColorString('#808000'));
  1591. /**
  1592. * An immutable Color instance initialized to CSS color #6B8E23
  1593. * <span class="colorSwath" style="background: #6B8E23;"></span>
  1594. *
  1595. * @constant
  1596. * @type {Color}
  1597. */
  1598. Color.OLIVEDRAB = freezeObject.freezeObject(Color.fromCssColorString('#6B8E23'));
  1599. /**
  1600. * An immutable Color instance initialized to CSS color #FFA500
  1601. * <span class="colorSwath" style="background: #FFA500;"></span>
  1602. *
  1603. * @constant
  1604. * @type {Color}
  1605. */
  1606. Color.ORANGE = freezeObject.freezeObject(Color.fromCssColorString('#FFA500'));
  1607. /**
  1608. * An immutable Color instance initialized to CSS color #FF4500
  1609. * <span class="colorSwath" style="background: #FF4500;"></span>
  1610. *
  1611. * @constant
  1612. * @type {Color}
  1613. */
  1614. Color.ORANGERED = freezeObject.freezeObject(Color.fromCssColorString('#FF4500'));
  1615. /**
  1616. * An immutable Color instance initialized to CSS color #DA70D6
  1617. * <span class="colorSwath" style="background: #DA70D6;"></span>
  1618. *
  1619. * @constant
  1620. * @type {Color}
  1621. */
  1622. Color.ORCHID = freezeObject.freezeObject(Color.fromCssColorString('#DA70D6'));
  1623. /**
  1624. * An immutable Color instance initialized to CSS color #EEE8AA
  1625. * <span class="colorSwath" style="background: #EEE8AA;"></span>
  1626. *
  1627. * @constant
  1628. * @type {Color}
  1629. */
  1630. Color.PALEGOLDENROD = freezeObject.freezeObject(Color.fromCssColorString('#EEE8AA'));
  1631. /**
  1632. * An immutable Color instance initialized to CSS color #98FB98
  1633. * <span class="colorSwath" style="background: #98FB98;"></span>
  1634. *
  1635. * @constant
  1636. * @type {Color}
  1637. */
  1638. Color.PALEGREEN = freezeObject.freezeObject(Color.fromCssColorString('#98FB98'));
  1639. /**
  1640. * An immutable Color instance initialized to CSS color #AFEEEE
  1641. * <span class="colorSwath" style="background: #AFEEEE;"></span>
  1642. *
  1643. * @constant
  1644. * @type {Color}
  1645. */
  1646. Color.PALETURQUOISE = freezeObject.freezeObject(Color.fromCssColorString('#AFEEEE'));
  1647. /**
  1648. * An immutable Color instance initialized to CSS color #DB7093
  1649. * <span class="colorSwath" style="background: #DB7093;"></span>
  1650. *
  1651. * @constant
  1652. * @type {Color}
  1653. */
  1654. Color.PALEVIOLETRED = freezeObject.freezeObject(Color.fromCssColorString('#DB7093'));
  1655. /**
  1656. * An immutable Color instance initialized to CSS color #FFEFD5
  1657. * <span class="colorSwath" style="background: #FFEFD5;"></span>
  1658. *
  1659. * @constant
  1660. * @type {Color}
  1661. */
  1662. Color.PAPAYAWHIP = freezeObject.freezeObject(Color.fromCssColorString('#FFEFD5'));
  1663. /**
  1664. * An immutable Color instance initialized to CSS color #FFDAB9
  1665. * <span class="colorSwath" style="background: #FFDAB9;"></span>
  1666. *
  1667. * @constant
  1668. * @type {Color}
  1669. */
  1670. Color.PEACHPUFF = freezeObject.freezeObject(Color.fromCssColorString('#FFDAB9'));
  1671. /**
  1672. * An immutable Color instance initialized to CSS color #CD853F
  1673. * <span class="colorSwath" style="background: #CD853F;"></span>
  1674. *
  1675. * @constant
  1676. * @type {Color}
  1677. */
  1678. Color.PERU = freezeObject.freezeObject(Color.fromCssColorString('#CD853F'));
  1679. /**
  1680. * An immutable Color instance initialized to CSS color #FFC0CB
  1681. * <span class="colorSwath" style="background: #FFC0CB;"></span>
  1682. *
  1683. * @constant
  1684. * @type {Color}
  1685. */
  1686. Color.PINK = freezeObject.freezeObject(Color.fromCssColorString('#FFC0CB'));
  1687. /**
  1688. * An immutable Color instance initialized to CSS color #DDA0DD
  1689. * <span class="colorSwath" style="background: #DDA0DD;"></span>
  1690. *
  1691. * @constant
  1692. * @type {Color}
  1693. */
  1694. Color.PLUM = freezeObject.freezeObject(Color.fromCssColorString('#DDA0DD'));
  1695. /**
  1696. * An immutable Color instance initialized to CSS color #B0E0E6
  1697. * <span class="colorSwath" style="background: #B0E0E6;"></span>
  1698. *
  1699. * @constant
  1700. * @type {Color}
  1701. */
  1702. Color.POWDERBLUE = freezeObject.freezeObject(Color.fromCssColorString('#B0E0E6'));
  1703. /**
  1704. * An immutable Color instance initialized to CSS color #800080
  1705. * <span class="colorSwath" style="background: #800080;"></span>
  1706. *
  1707. * @constant
  1708. * @type {Color}
  1709. */
  1710. Color.PURPLE = freezeObject.freezeObject(Color.fromCssColorString('#800080'));
  1711. /**
  1712. * An immutable Color instance initialized to CSS color #FF0000
  1713. * <span class="colorSwath" style="background: #FF0000;"></span>
  1714. *
  1715. * @constant
  1716. * @type {Color}
  1717. */
  1718. Color.RED = freezeObject.freezeObject(Color.fromCssColorString('#FF0000'));
  1719. /**
  1720. * An immutable Color instance initialized to CSS color #BC8F8F
  1721. * <span class="colorSwath" style="background: #BC8F8F;"></span>
  1722. *
  1723. * @constant
  1724. * @type {Color}
  1725. */
  1726. Color.ROSYBROWN = freezeObject.freezeObject(Color.fromCssColorString('#BC8F8F'));
  1727. /**
  1728. * An immutable Color instance initialized to CSS color #4169E1
  1729. * <span class="colorSwath" style="background: #4169E1;"></span>
  1730. *
  1731. * @constant
  1732. * @type {Color}
  1733. */
  1734. Color.ROYALBLUE = freezeObject.freezeObject(Color.fromCssColorString('#4169E1'));
  1735. /**
  1736. * An immutable Color instance initialized to CSS color #8B4513
  1737. * <span class="colorSwath" style="background: #8B4513;"></span>
  1738. *
  1739. * @constant
  1740. * @type {Color}
  1741. */
  1742. Color.SADDLEBROWN = freezeObject.freezeObject(Color.fromCssColorString('#8B4513'));
  1743. /**
  1744. * An immutable Color instance initialized to CSS color #FA8072
  1745. * <span class="colorSwath" style="background: #FA8072;"></span>
  1746. *
  1747. * @constant
  1748. * @type {Color}
  1749. */
  1750. Color.SALMON = freezeObject.freezeObject(Color.fromCssColorString('#FA8072'));
  1751. /**
  1752. * An immutable Color instance initialized to CSS color #F4A460
  1753. * <span class="colorSwath" style="background: #F4A460;"></span>
  1754. *
  1755. * @constant
  1756. * @type {Color}
  1757. */
  1758. Color.SANDYBROWN = freezeObject.freezeObject(Color.fromCssColorString('#F4A460'));
  1759. /**
  1760. * An immutable Color instance initialized to CSS color #2E8B57
  1761. * <span class="colorSwath" style="background: #2E8B57;"></span>
  1762. *
  1763. * @constant
  1764. * @type {Color}
  1765. */
  1766. Color.SEAGREEN = freezeObject.freezeObject(Color.fromCssColorString('#2E8B57'));
  1767. /**
  1768. * An immutable Color instance initialized to CSS color #FFF5EE
  1769. * <span class="colorSwath" style="background: #FFF5EE;"></span>
  1770. *
  1771. * @constant
  1772. * @type {Color}
  1773. */
  1774. Color.SEASHELL = freezeObject.freezeObject(Color.fromCssColorString('#FFF5EE'));
  1775. /**
  1776. * An immutable Color instance initialized to CSS color #A0522D
  1777. * <span class="colorSwath" style="background: #A0522D;"></span>
  1778. *
  1779. * @constant
  1780. * @type {Color}
  1781. */
  1782. Color.SIENNA = freezeObject.freezeObject(Color.fromCssColorString('#A0522D'));
  1783. /**
  1784. * An immutable Color instance initialized to CSS color #C0C0C0
  1785. * <span class="colorSwath" style="background: #C0C0C0;"></span>
  1786. *
  1787. * @constant
  1788. * @type {Color}
  1789. */
  1790. Color.SILVER = freezeObject.freezeObject(Color.fromCssColorString('#C0C0C0'));
  1791. /**
  1792. * An immutable Color instance initialized to CSS color #87CEEB
  1793. * <span class="colorSwath" style="background: #87CEEB;"></span>
  1794. *
  1795. * @constant
  1796. * @type {Color}
  1797. */
  1798. Color.SKYBLUE = freezeObject.freezeObject(Color.fromCssColorString('#87CEEB'));
  1799. /**
  1800. * An immutable Color instance initialized to CSS color #6A5ACD
  1801. * <span class="colorSwath" style="background: #6A5ACD;"></span>
  1802. *
  1803. * @constant
  1804. * @type {Color}
  1805. */
  1806. Color.SLATEBLUE = freezeObject.freezeObject(Color.fromCssColorString('#6A5ACD'));
  1807. /**
  1808. * An immutable Color instance initialized to CSS color #708090
  1809. * <span class="colorSwath" style="background: #708090;"></span>
  1810. *
  1811. * @constant
  1812. * @type {Color}
  1813. */
  1814. Color.SLATEGRAY = freezeObject.freezeObject(Color.fromCssColorString('#708090'));
  1815. /**
  1816. * An immutable Color instance initialized to CSS color #708090
  1817. * <span class="colorSwath" style="background: #708090;"></span>
  1818. *
  1819. * @constant
  1820. * @type {Color}
  1821. */
  1822. Color.SLATEGREY = Color.SLATEGRAY;
  1823. /**
  1824. * An immutable Color instance initialized to CSS color #FFFAFA
  1825. * <span class="colorSwath" style="background: #FFFAFA;"></span>
  1826. *
  1827. * @constant
  1828. * @type {Color}
  1829. */
  1830. Color.SNOW = freezeObject.freezeObject(Color.fromCssColorString('#FFFAFA'));
  1831. /**
  1832. * An immutable Color instance initialized to CSS color #00FF7F
  1833. * <span class="colorSwath" style="background: #00FF7F;"></span>
  1834. *
  1835. * @constant
  1836. * @type {Color}
  1837. */
  1838. Color.SPRINGGREEN = freezeObject.freezeObject(Color.fromCssColorString('#00FF7F'));
  1839. /**
  1840. * An immutable Color instance initialized to CSS color #4682B4
  1841. * <span class="colorSwath" style="background: #4682B4;"></span>
  1842. *
  1843. * @constant
  1844. * @type {Color}
  1845. */
  1846. Color.STEELBLUE = freezeObject.freezeObject(Color.fromCssColorString('#4682B4'));
  1847. /**
  1848. * An immutable Color instance initialized to CSS color #D2B48C
  1849. * <span class="colorSwath" style="background: #D2B48C;"></span>
  1850. *
  1851. * @constant
  1852. * @type {Color}
  1853. */
  1854. Color.TAN = freezeObject.freezeObject(Color.fromCssColorString('#D2B48C'));
  1855. /**
  1856. * An immutable Color instance initialized to CSS color #008080
  1857. * <span class="colorSwath" style="background: #008080;"></span>
  1858. *
  1859. * @constant
  1860. * @type {Color}
  1861. */
  1862. Color.TEAL = freezeObject.freezeObject(Color.fromCssColorString('#008080'));
  1863. /**
  1864. * An immutable Color instance initialized to CSS color #D8BFD8
  1865. * <span class="colorSwath" style="background: #D8BFD8;"></span>
  1866. *
  1867. * @constant
  1868. * @type {Color}
  1869. */
  1870. Color.THISTLE = freezeObject.freezeObject(Color.fromCssColorString('#D8BFD8'));
  1871. /**
  1872. * An immutable Color instance initialized to CSS color #FF6347
  1873. * <span class="colorSwath" style="background: #FF6347;"></span>
  1874. *
  1875. * @constant
  1876. * @type {Color}
  1877. */
  1878. Color.TOMATO = freezeObject.freezeObject(Color.fromCssColorString('#FF6347'));
  1879. /**
  1880. * An immutable Color instance initialized to CSS color #40E0D0
  1881. * <span class="colorSwath" style="background: #40E0D0;"></span>
  1882. *
  1883. * @constant
  1884. * @type {Color}
  1885. */
  1886. Color.TURQUOISE = freezeObject.freezeObject(Color.fromCssColorString('#40E0D0'));
  1887. /**
  1888. * An immutable Color instance initialized to CSS color #EE82EE
  1889. * <span class="colorSwath" style="background: #EE82EE;"></span>
  1890. *
  1891. * @constant
  1892. * @type {Color}
  1893. */
  1894. Color.VIOLET = freezeObject.freezeObject(Color.fromCssColorString('#EE82EE'));
  1895. /**
  1896. * An immutable Color instance initialized to CSS color #F5DEB3
  1897. * <span class="colorSwath" style="background: #F5DEB3;"></span>
  1898. *
  1899. * @constant
  1900. * @type {Color}
  1901. */
  1902. Color.WHEAT = freezeObject.freezeObject(Color.fromCssColorString('#F5DEB3'));
  1903. /**
  1904. * An immutable Color instance initialized to CSS color #FFFFFF
  1905. * <span class="colorSwath" style="background: #FFFFFF;"></span>
  1906. *
  1907. * @constant
  1908. * @type {Color}
  1909. */
  1910. Color.WHITE = freezeObject.freezeObject(Color.fromCssColorString('#FFFFFF'));
  1911. /**
  1912. * An immutable Color instance initialized to CSS color #F5F5F5
  1913. * <span class="colorSwath" style="background: #F5F5F5;"></span>
  1914. *
  1915. * @constant
  1916. * @type {Color}
  1917. */
  1918. Color.WHITESMOKE = freezeObject.freezeObject(Color.fromCssColorString('#F5F5F5'));
  1919. /**
  1920. * An immutable Color instance initialized to CSS color #FFFF00
  1921. * <span class="colorSwath" style="background: #FFFF00;"></span>
  1922. *
  1923. * @constant
  1924. * @type {Color}
  1925. */
  1926. Color.YELLOW = freezeObject.freezeObject(Color.fromCssColorString('#FFFF00'));
  1927. /**
  1928. * An immutable Color instance initialized to CSS color #9ACD32
  1929. * <span class="colorSwath" style="background: #9ACD32;"></span>
  1930. *
  1931. * @constant
  1932. * @type {Color}
  1933. */
  1934. Color.YELLOWGREEN = freezeObject.freezeObject(Color.fromCssColorString('#9ACD32'));
  1935. /**
  1936. * An immutable Color instance initialized to CSS transparent.
  1937. * <span class="colorSwath" style="background: transparent;"></span>
  1938. *
  1939. * @constant
  1940. * @type {Color}
  1941. */
  1942. Color.TRANSPARENT = freezeObject.freezeObject(new Color(0, 0, 0, 0));
  1943. exports.Color = Color;
  1944. });