@codingame/monaco-vscode-api 1.69.1 → 1.69.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/missing-services.js +501 -16
- package/package.json +1 -1
package/dist/missing-services.js
CHANGED
|
@@ -6,7 +6,7 @@ import { mixin, equals, deepClone, deepFreeze } from 'monaco-editor/esm/vs/base/
|
|
|
6
6
|
import { RunOnceScheduler, Promises, timeout } from 'monaco-editor/esm/vs/base/common/async.js';
|
|
7
7
|
import { trackFocus, show, hide, createStyleSheet } from 'monaco-editor/esm/vs/base/browser/dom.js';
|
|
8
8
|
import { isNumber, isObject as isObject$1, isUndefinedOrNull as isUndefinedOrNull$1 } from 'monaco-editor/esm/vs/base/common/types.js';
|
|
9
|
-
import { Color } from 'monaco-editor/esm/vs/base/common/color.js';
|
|
9
|
+
import { Color as Color$1 } from 'monaco-editor/esm/vs/base/common/color.js';
|
|
10
10
|
import { LanguageService as LanguageService$1 } from 'monaco-editor/esm/vs/editor/common/services/languageService.js';
|
|
11
11
|
import { LanguagesRegistry as LanguagesRegistry$1 } from 'monaco-editor/esm/vs/editor/common/services/languagesRegistry.js';
|
|
12
12
|
import { firstOrDefault, distinct, equals as equals$1, binarySearch, range } from 'monaco-editor/esm/vs/base/common/arrays.js';
|
|
@@ -1009,7 +1009,7 @@ const CSS_INFINITE = 'infinite';
|
|
|
1009
1009
|
const CSS_INFINITE_LONG_RUNNING = 'infinite-long-running';
|
|
1010
1010
|
const CSS_DISCRETE = 'discrete';
|
|
1011
1011
|
const defaultOpts = {
|
|
1012
|
-
progressBarBackground: ( (Color.fromHex('#0E70C0')))
|
|
1012
|
+
progressBarBackground: ( (Color$1.fromHex('#0E70C0')))
|
|
1013
1013
|
};
|
|
1014
1014
|
class ProgressBar extends Disposable {
|
|
1015
1015
|
constructor(container, options) {
|
|
@@ -5054,20 +5054,20 @@ class DefaultStyleController {
|
|
|
5054
5054
|
}
|
|
5055
5055
|
}
|
|
5056
5056
|
const defaultStyles = {
|
|
5057
|
-
listFocusBackground: ( (Color.fromHex('#7FB0D0'))),
|
|
5058
|
-
listActiveSelectionBackground: ( (Color.fromHex('#0E639C'))),
|
|
5059
|
-
listActiveSelectionForeground: ( (Color.fromHex('#FFFFFF'))),
|
|
5060
|
-
listActiveSelectionIconForeground: ( (Color.fromHex('#FFFFFF'))),
|
|
5061
|
-
listFocusAndSelectionOutline: ( (Color.fromHex('#90C2F9'))),
|
|
5062
|
-
listFocusAndSelectionBackground: ( (Color.fromHex('#094771'))),
|
|
5063
|
-
listFocusAndSelectionForeground: ( (Color.fromHex('#FFFFFF'))),
|
|
5064
|
-
listInactiveSelectionBackground: ( (Color.fromHex('#3F3F46'))),
|
|
5065
|
-
listInactiveSelectionIconForeground: ( (Color.fromHex('#FFFFFF'))),
|
|
5066
|
-
listHoverBackground: ( (Color.fromHex('#2A2D2E'))),
|
|
5067
|
-
listDropBackground: ( (Color.fromHex('#383B3D'))),
|
|
5068
|
-
treeIndentGuidesStroke: ( (Color.fromHex('#a9a9a9'))),
|
|
5069
|
-
tableColumnsBorder: ( (( (Color.fromHex('#cccccc'))).transparent(0.2))),
|
|
5070
|
-
tableOddRowsBackgroundColor: ( (( (Color.fromHex('#cccccc'))).transparent(0.04)))
|
|
5057
|
+
listFocusBackground: ( (Color$1.fromHex('#7FB0D0'))),
|
|
5058
|
+
listActiveSelectionBackground: ( (Color$1.fromHex('#0E639C'))),
|
|
5059
|
+
listActiveSelectionForeground: ( (Color$1.fromHex('#FFFFFF'))),
|
|
5060
|
+
listActiveSelectionIconForeground: ( (Color$1.fromHex('#FFFFFF'))),
|
|
5061
|
+
listFocusAndSelectionOutline: ( (Color$1.fromHex('#90C2F9'))),
|
|
5062
|
+
listFocusAndSelectionBackground: ( (Color$1.fromHex('#094771'))),
|
|
5063
|
+
listFocusAndSelectionForeground: ( (Color$1.fromHex('#FFFFFF'))),
|
|
5064
|
+
listInactiveSelectionBackground: ( (Color$1.fromHex('#3F3F46'))),
|
|
5065
|
+
listInactiveSelectionIconForeground: ( (Color$1.fromHex('#FFFFFF'))),
|
|
5066
|
+
listHoverBackground: ( (Color$1.fromHex('#2A2D2E'))),
|
|
5067
|
+
listDropBackground: ( (Color$1.fromHex('#383B3D'))),
|
|
5068
|
+
treeIndentGuidesStroke: ( (Color$1.fromHex('#a9a9a9'))),
|
|
5069
|
+
tableColumnsBorder: ( (( (Color$1.fromHex('#cccccc'))).transparent(0.2))),
|
|
5070
|
+
tableOddRowsBackgroundColor: ( (( (Color$1.fromHex('#cccccc'))).transparent(0.04)))
|
|
5071
5071
|
};
|
|
5072
5072
|
const DefaultOptions = {
|
|
5073
5073
|
keyboardSupport: true,
|
|
@@ -5713,6 +5713,490 @@ class List {
|
|
|
5713
5713
|
this._onDidDispose.dispose();
|
|
5714
5714
|
}
|
|
5715
5715
|
}
|
|
5716
|
+
function roundFloat(number, decimalPoints) {
|
|
5717
|
+
const decimal = Math.pow(10, decimalPoints);
|
|
5718
|
+
return Math.round(number * decimal) / decimal;
|
|
5719
|
+
}
|
|
5720
|
+
class RGBA {
|
|
5721
|
+
constructor(r, g, b, a = 1) {
|
|
5722
|
+
this._rgbaBrand = undefined;
|
|
5723
|
+
this.r = Math.min(255, Math.max(0, r)) | 0;
|
|
5724
|
+
this.g = Math.min(255, Math.max(0, g)) | 0;
|
|
5725
|
+
this.b = Math.min(255, Math.max(0, b)) | 0;
|
|
5726
|
+
this.a = roundFloat(Math.max(Math.min(1, a), 0), 3);
|
|
5727
|
+
}
|
|
5728
|
+
static equals(a, b) {
|
|
5729
|
+
return a.r === b.r && a.g === b.g && a.b === b.b && a.a === b.a;
|
|
5730
|
+
}
|
|
5731
|
+
}
|
|
5732
|
+
class HSLA {
|
|
5733
|
+
constructor(h, s, l, a) {
|
|
5734
|
+
this._hslaBrand = undefined;
|
|
5735
|
+
this.h = Math.max(Math.min(360, h), 0) | 0;
|
|
5736
|
+
this.s = roundFloat(Math.max(Math.min(1, s), 0), 3);
|
|
5737
|
+
this.l = roundFloat(Math.max(Math.min(1, l), 0), 3);
|
|
5738
|
+
this.a = roundFloat(Math.max(Math.min(1, a), 0), 3);
|
|
5739
|
+
}
|
|
5740
|
+
static equals(a, b) {
|
|
5741
|
+
return a.h === b.h && a.s === b.s && a.l === b.l && a.a === b.a;
|
|
5742
|
+
}
|
|
5743
|
+
static fromRGBA(rgba) {
|
|
5744
|
+
const r = rgba.r / 255;
|
|
5745
|
+
const g = rgba.g / 255;
|
|
5746
|
+
const b = rgba.b / 255;
|
|
5747
|
+
const a = rgba.a;
|
|
5748
|
+
const max = Math.max(r, g, b);
|
|
5749
|
+
const min = Math.min(r, g, b);
|
|
5750
|
+
let h = 0;
|
|
5751
|
+
let s = 0;
|
|
5752
|
+
const l = (min + max) / 2;
|
|
5753
|
+
const chroma = max - min;
|
|
5754
|
+
if (chroma > 0) {
|
|
5755
|
+
s = Math.min((l <= 0.5 ? chroma / (2 * l) : chroma / (2 - (2 * l))), 1);
|
|
5756
|
+
switch (max) {
|
|
5757
|
+
case r:
|
|
5758
|
+
h = (g - b) / chroma + (g < b ? 6 : 0);
|
|
5759
|
+
break;
|
|
5760
|
+
case g:
|
|
5761
|
+
h = (b - r) / chroma + 2;
|
|
5762
|
+
break;
|
|
5763
|
+
case b:
|
|
5764
|
+
h = (r - g) / chroma + 4;
|
|
5765
|
+
break;
|
|
5766
|
+
}
|
|
5767
|
+
h *= 60;
|
|
5768
|
+
h = Math.round(h);
|
|
5769
|
+
}
|
|
5770
|
+
return (
|
|
5771
|
+
(new HSLA(h, s, l, a))
|
|
5772
|
+
);
|
|
5773
|
+
}
|
|
5774
|
+
static _hue2rgb(p, q, t) {
|
|
5775
|
+
if (t < 0) {
|
|
5776
|
+
t += 1;
|
|
5777
|
+
}
|
|
5778
|
+
if (t > 1) {
|
|
5779
|
+
t -= 1;
|
|
5780
|
+
}
|
|
5781
|
+
if (t < 1 / 6) {
|
|
5782
|
+
return p + (q - p) * 6 * t;
|
|
5783
|
+
}
|
|
5784
|
+
if (t < 1 / 2) {
|
|
5785
|
+
return q;
|
|
5786
|
+
}
|
|
5787
|
+
if (t < 2 / 3) {
|
|
5788
|
+
return p + (q - p) * (2 / 3 - t) * 6;
|
|
5789
|
+
}
|
|
5790
|
+
return p;
|
|
5791
|
+
}
|
|
5792
|
+
static toRGBA(hsla) {
|
|
5793
|
+
const h = hsla.h / 360;
|
|
5794
|
+
const { s, l, a } = hsla;
|
|
5795
|
+
let r, g, b;
|
|
5796
|
+
if (s === 0) {
|
|
5797
|
+
r = g = b = l;
|
|
5798
|
+
}
|
|
5799
|
+
else {
|
|
5800
|
+
const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
|
5801
|
+
const p = 2 * l - q;
|
|
5802
|
+
r = HSLA._hue2rgb(p, q, h + 1 / 3);
|
|
5803
|
+
g = HSLA._hue2rgb(p, q, h);
|
|
5804
|
+
b = HSLA._hue2rgb(p, q, h - 1 / 3);
|
|
5805
|
+
}
|
|
5806
|
+
return (
|
|
5807
|
+
(new RGBA(Math.round(r * 255), Math.round(g * 255), Math.round(b * 255), a))
|
|
5808
|
+
);
|
|
5809
|
+
}
|
|
5810
|
+
}
|
|
5811
|
+
class HSVA {
|
|
5812
|
+
constructor(h, s, v, a) {
|
|
5813
|
+
this._hsvaBrand = undefined;
|
|
5814
|
+
this.h = Math.max(Math.min(360, h), 0) | 0;
|
|
5815
|
+
this.s = roundFloat(Math.max(Math.min(1, s), 0), 3);
|
|
5816
|
+
this.v = roundFloat(Math.max(Math.min(1, v), 0), 3);
|
|
5817
|
+
this.a = roundFloat(Math.max(Math.min(1, a), 0), 3);
|
|
5818
|
+
}
|
|
5819
|
+
static equals(a, b) {
|
|
5820
|
+
return a.h === b.h && a.s === b.s && a.v === b.v && a.a === b.a;
|
|
5821
|
+
}
|
|
5822
|
+
static fromRGBA(rgba) {
|
|
5823
|
+
const r = rgba.r / 255;
|
|
5824
|
+
const g = rgba.g / 255;
|
|
5825
|
+
const b = rgba.b / 255;
|
|
5826
|
+
const cmax = Math.max(r, g, b);
|
|
5827
|
+
const cmin = Math.min(r, g, b);
|
|
5828
|
+
const delta = cmax - cmin;
|
|
5829
|
+
const s = cmax === 0 ? 0 : (delta / cmax);
|
|
5830
|
+
let m;
|
|
5831
|
+
if (delta === 0) {
|
|
5832
|
+
m = 0;
|
|
5833
|
+
}
|
|
5834
|
+
else if (cmax === r) {
|
|
5835
|
+
m = ((((g - b) / delta) % 6) + 6) % 6;
|
|
5836
|
+
}
|
|
5837
|
+
else if (cmax === g) {
|
|
5838
|
+
m = ((b - r) / delta) + 2;
|
|
5839
|
+
}
|
|
5840
|
+
else {
|
|
5841
|
+
m = ((r - g) / delta) + 4;
|
|
5842
|
+
}
|
|
5843
|
+
return (
|
|
5844
|
+
(new HSVA(Math.round(m * 60), s, cmax, rgba.a))
|
|
5845
|
+
);
|
|
5846
|
+
}
|
|
5847
|
+
static toRGBA(hsva) {
|
|
5848
|
+
const { h, s, v, a } = hsva;
|
|
5849
|
+
const c = v * s;
|
|
5850
|
+
const x = c * (1 - Math.abs((h / 60) % 2 - 1));
|
|
5851
|
+
const m = v - c;
|
|
5852
|
+
let [r, g, b] = [0, 0, 0];
|
|
5853
|
+
if (h < 60) {
|
|
5854
|
+
r = c;
|
|
5855
|
+
g = x;
|
|
5856
|
+
}
|
|
5857
|
+
else if (h < 120) {
|
|
5858
|
+
r = x;
|
|
5859
|
+
g = c;
|
|
5860
|
+
}
|
|
5861
|
+
else if (h < 180) {
|
|
5862
|
+
g = c;
|
|
5863
|
+
b = x;
|
|
5864
|
+
}
|
|
5865
|
+
else if (h < 240) {
|
|
5866
|
+
g = x;
|
|
5867
|
+
b = c;
|
|
5868
|
+
}
|
|
5869
|
+
else if (h < 300) {
|
|
5870
|
+
r = x;
|
|
5871
|
+
b = c;
|
|
5872
|
+
}
|
|
5873
|
+
else if (h <= 360) {
|
|
5874
|
+
r = c;
|
|
5875
|
+
b = x;
|
|
5876
|
+
}
|
|
5877
|
+
r = Math.round((r + m) * 255);
|
|
5878
|
+
g = Math.round((g + m) * 255);
|
|
5879
|
+
b = Math.round((b + m) * 255);
|
|
5880
|
+
return (
|
|
5881
|
+
(new RGBA(r, g, b, a))
|
|
5882
|
+
);
|
|
5883
|
+
}
|
|
5884
|
+
}
|
|
5885
|
+
class Color {
|
|
5886
|
+
constructor(arg) {
|
|
5887
|
+
if (!arg) {
|
|
5888
|
+
throw new Error('Color needs a value');
|
|
5889
|
+
}
|
|
5890
|
+
else if (arg instanceof RGBA) {
|
|
5891
|
+
this.rgba = arg;
|
|
5892
|
+
}
|
|
5893
|
+
else if (arg instanceof HSLA) {
|
|
5894
|
+
this._hsla = arg;
|
|
5895
|
+
this.rgba = HSLA.toRGBA(arg);
|
|
5896
|
+
}
|
|
5897
|
+
else if (arg instanceof HSVA) {
|
|
5898
|
+
this._hsva = arg;
|
|
5899
|
+
this.rgba = HSVA.toRGBA(arg);
|
|
5900
|
+
}
|
|
5901
|
+
else {
|
|
5902
|
+
throw new Error('Invalid color ctor argument');
|
|
5903
|
+
}
|
|
5904
|
+
}
|
|
5905
|
+
static fromHex(hex) {
|
|
5906
|
+
return Color.Format.CSS.parseHex(hex) || Color.red;
|
|
5907
|
+
}
|
|
5908
|
+
get hsla() {
|
|
5909
|
+
if (this._hsla) {
|
|
5910
|
+
return this._hsla;
|
|
5911
|
+
}
|
|
5912
|
+
else {
|
|
5913
|
+
return HSLA.fromRGBA(this.rgba);
|
|
5914
|
+
}
|
|
5915
|
+
}
|
|
5916
|
+
get hsva() {
|
|
5917
|
+
if (this._hsva) {
|
|
5918
|
+
return this._hsva;
|
|
5919
|
+
}
|
|
5920
|
+
return HSVA.fromRGBA(this.rgba);
|
|
5921
|
+
}
|
|
5922
|
+
equals(other) {
|
|
5923
|
+
return !!other && RGBA.equals(this.rgba, other.rgba) && HSLA.equals(this.hsla, other.hsla) && HSVA.equals(this.hsva, other.hsva);
|
|
5924
|
+
}
|
|
5925
|
+
getRelativeLuminance() {
|
|
5926
|
+
const R = Color._relativeLuminanceForComponent(this.rgba.r);
|
|
5927
|
+
const G = Color._relativeLuminanceForComponent(this.rgba.g);
|
|
5928
|
+
const B = Color._relativeLuminanceForComponent(this.rgba.b);
|
|
5929
|
+
const luminance = 0.2126 * R + 0.7152 * G + 0.0722 * B;
|
|
5930
|
+
return roundFloat(luminance, 4);
|
|
5931
|
+
}
|
|
5932
|
+
static _relativeLuminanceForComponent(color) {
|
|
5933
|
+
const c = color / 255;
|
|
5934
|
+
return (c <= 0.03928) ? c / 12.92 : Math.pow(((c + 0.055) / 1.055), 2.4);
|
|
5935
|
+
}
|
|
5936
|
+
getContrastRatio(another) {
|
|
5937
|
+
const lum1 = this.getRelativeLuminance();
|
|
5938
|
+
const lum2 = another.getRelativeLuminance();
|
|
5939
|
+
return lum1 > lum2 ? (lum1 + 0.05) / (lum2 + 0.05) : (lum2 + 0.05) / (lum1 + 0.05);
|
|
5940
|
+
}
|
|
5941
|
+
isDarker() {
|
|
5942
|
+
const yiq = (this.rgba.r * 299 + this.rgba.g * 587 + this.rgba.b * 114) / 1000;
|
|
5943
|
+
return yiq < 128;
|
|
5944
|
+
}
|
|
5945
|
+
isLighter() {
|
|
5946
|
+
const yiq = (this.rgba.r * 299 + this.rgba.g * 587 + this.rgba.b * 114) / 1000;
|
|
5947
|
+
return yiq >= 128;
|
|
5948
|
+
}
|
|
5949
|
+
isLighterThan(another) {
|
|
5950
|
+
const lum1 = this.getRelativeLuminance();
|
|
5951
|
+
const lum2 = another.getRelativeLuminance();
|
|
5952
|
+
return lum1 > lum2;
|
|
5953
|
+
}
|
|
5954
|
+
isDarkerThan(another) {
|
|
5955
|
+
const lum1 = this.getRelativeLuminance();
|
|
5956
|
+
const lum2 = another.getRelativeLuminance();
|
|
5957
|
+
return lum1 < lum2;
|
|
5958
|
+
}
|
|
5959
|
+
lighten(factor) {
|
|
5960
|
+
return (
|
|
5961
|
+
(new Color(
|
|
5962
|
+
(new HSLA(this.hsla.h, this.hsla.s, this.hsla.l + this.hsla.l * factor, this.hsla.a))
|
|
5963
|
+
))
|
|
5964
|
+
);
|
|
5965
|
+
}
|
|
5966
|
+
darken(factor) {
|
|
5967
|
+
return (
|
|
5968
|
+
(new Color(
|
|
5969
|
+
(new HSLA(this.hsla.h, this.hsla.s, this.hsla.l - this.hsla.l * factor, this.hsla.a))
|
|
5970
|
+
))
|
|
5971
|
+
);
|
|
5972
|
+
}
|
|
5973
|
+
transparent(factor) {
|
|
5974
|
+
const { r, g, b, a } = this.rgba;
|
|
5975
|
+
return (
|
|
5976
|
+
(new Color( (new RGBA(r, g, b, a * factor))))
|
|
5977
|
+
);
|
|
5978
|
+
}
|
|
5979
|
+
isTransparent() {
|
|
5980
|
+
return this.rgba.a === 0;
|
|
5981
|
+
}
|
|
5982
|
+
isOpaque() {
|
|
5983
|
+
return this.rgba.a === 1;
|
|
5984
|
+
}
|
|
5985
|
+
opposite() {
|
|
5986
|
+
return (
|
|
5987
|
+
(new Color(
|
|
5988
|
+
(new RGBA(255 - this.rgba.r, 255 - this.rgba.g, 255 - this.rgba.b, this.rgba.a))
|
|
5989
|
+
))
|
|
5990
|
+
);
|
|
5991
|
+
}
|
|
5992
|
+
blend(c) {
|
|
5993
|
+
const rgba = c.rgba;
|
|
5994
|
+
const thisA = this.rgba.a;
|
|
5995
|
+
const colorA = rgba.a;
|
|
5996
|
+
const a = thisA + colorA * (1 - thisA);
|
|
5997
|
+
if (a < 1e-6) {
|
|
5998
|
+
return Color.transparent;
|
|
5999
|
+
}
|
|
6000
|
+
const r = this.rgba.r * thisA / a + rgba.r * colorA * (1 - thisA) / a;
|
|
6001
|
+
const g = this.rgba.g * thisA / a + rgba.g * colorA * (1 - thisA) / a;
|
|
6002
|
+
const b = this.rgba.b * thisA / a + rgba.b * colorA * (1 - thisA) / a;
|
|
6003
|
+
return (
|
|
6004
|
+
(new Color( (new RGBA(r, g, b, a))))
|
|
6005
|
+
);
|
|
6006
|
+
}
|
|
6007
|
+
makeOpaque(opaqueBackground) {
|
|
6008
|
+
if (this.isOpaque() || opaqueBackground.rgba.a !== 1) {
|
|
6009
|
+
return this;
|
|
6010
|
+
}
|
|
6011
|
+
const { r, g, b, a } = this.rgba;
|
|
6012
|
+
return (
|
|
6013
|
+
(new Color( (new RGBA(
|
|
6014
|
+
opaqueBackground.rgba.r - a * (opaqueBackground.rgba.r - r),
|
|
6015
|
+
opaqueBackground.rgba.g - a * (opaqueBackground.rgba.g - g),
|
|
6016
|
+
opaqueBackground.rgba.b - a * (opaqueBackground.rgba.b - b),
|
|
6017
|
+
1
|
|
6018
|
+
))))
|
|
6019
|
+
);
|
|
6020
|
+
}
|
|
6021
|
+
flatten(...backgrounds) {
|
|
6022
|
+
const background = backgrounds.reduceRight((accumulator, color) => {
|
|
6023
|
+
return Color._flatten(color, accumulator);
|
|
6024
|
+
});
|
|
6025
|
+
return Color._flatten(this, background);
|
|
6026
|
+
}
|
|
6027
|
+
static _flatten(foreground, background) {
|
|
6028
|
+
const backgroundAlpha = 1 - foreground.rgba.a;
|
|
6029
|
+
return (
|
|
6030
|
+
(new Color( (new RGBA(
|
|
6031
|
+
backgroundAlpha * background.rgba.r + foreground.rgba.a * foreground.rgba.r,
|
|
6032
|
+
backgroundAlpha * background.rgba.g + foreground.rgba.a * foreground.rgba.g,
|
|
6033
|
+
backgroundAlpha * background.rgba.b + foreground.rgba.a * foreground.rgba.b
|
|
6034
|
+
))))
|
|
6035
|
+
);
|
|
6036
|
+
}
|
|
6037
|
+
toString() {
|
|
6038
|
+
if (!this._toString) {
|
|
6039
|
+
this._toString = Color.Format.CSS.format(this);
|
|
6040
|
+
}
|
|
6041
|
+
return this._toString;
|
|
6042
|
+
}
|
|
6043
|
+
static getLighterColor(of, relative, factor) {
|
|
6044
|
+
if (of.isLighterThan(relative)) {
|
|
6045
|
+
return of;
|
|
6046
|
+
}
|
|
6047
|
+
factor = factor ? factor : 0.5;
|
|
6048
|
+
const lum1 = of.getRelativeLuminance();
|
|
6049
|
+
const lum2 = relative.getRelativeLuminance();
|
|
6050
|
+
factor = factor * (lum2 - lum1) / lum2;
|
|
6051
|
+
return (
|
|
6052
|
+
(of.lighten(factor))
|
|
6053
|
+
);
|
|
6054
|
+
}
|
|
6055
|
+
static getDarkerColor(of, relative, factor) {
|
|
6056
|
+
if (of.isDarkerThan(relative)) {
|
|
6057
|
+
return of;
|
|
6058
|
+
}
|
|
6059
|
+
factor = factor ? factor : 0.5;
|
|
6060
|
+
const lum1 = of.getRelativeLuminance();
|
|
6061
|
+
const lum2 = relative.getRelativeLuminance();
|
|
6062
|
+
factor = factor * (lum1 - lum2) / lum1;
|
|
6063
|
+
return (
|
|
6064
|
+
(of.darken(factor))
|
|
6065
|
+
);
|
|
6066
|
+
}
|
|
6067
|
+
}
|
|
6068
|
+
Color.white = ( (new Color( (new RGBA(255, 255, 255, 1)))));
|
|
6069
|
+
Color.black = ( (new Color( (new RGBA(0, 0, 0, 1)))));
|
|
6070
|
+
Color.red = ( (new Color( (new RGBA(255, 0, 0, 1)))));
|
|
6071
|
+
Color.blue = ( (new Color( (new RGBA(0, 0, 255, 1)))));
|
|
6072
|
+
Color.green = ( (new Color( (new RGBA(0, 255, 0, 1)))));
|
|
6073
|
+
Color.cyan = ( (new Color( (new RGBA(0, 255, 255, 1)))));
|
|
6074
|
+
Color.lightgrey = ( (new Color( (new RGBA(211, 211, 211, 1)))));
|
|
6075
|
+
Color.transparent = ( (new Color( (new RGBA(0, 0, 0, 0)))));
|
|
6076
|
+
( ((function(Color) {
|
|
6077
|
+
( ((function(Format) {
|
|
6078
|
+
( ((function(CSS) {
|
|
6079
|
+
function formatRGB(color) {
|
|
6080
|
+
if (color.rgba.a === 1) {
|
|
6081
|
+
return `rgb(${color.rgba.r}, ${color.rgba.g}, ${color.rgba.b})`;
|
|
6082
|
+
}
|
|
6083
|
+
return Color.Format.CSS.formatRGBA(color);
|
|
6084
|
+
}
|
|
6085
|
+
CSS.formatRGB = formatRGB;
|
|
6086
|
+
function formatRGBA(color) {
|
|
6087
|
+
return `rgba(${color.rgba.r}, ${color.rgba.g}, ${color.rgba.b}, ${+(color.rgba.a).toFixed(2)})`;
|
|
6088
|
+
}
|
|
6089
|
+
CSS.formatRGBA = formatRGBA;
|
|
6090
|
+
function formatHSL(color) {
|
|
6091
|
+
if (color.hsla.a === 1) {
|
|
6092
|
+
return `hsl(${color.hsla.h}, ${(color.hsla.s * 100).toFixed(2)}%, ${(color.hsla.l * 100).toFixed(2)}%)`;
|
|
6093
|
+
}
|
|
6094
|
+
return Color.Format.CSS.formatHSLA(color);
|
|
6095
|
+
}
|
|
6096
|
+
CSS.formatHSL = formatHSL;
|
|
6097
|
+
function formatHSLA(color) {
|
|
6098
|
+
return `hsla(${color.hsla.h}, ${(color.hsla.s * 100).toFixed(2)}%, ${(color.hsla.l * 100).toFixed(2)}%, ${color.hsla.a.toFixed(2)})`;
|
|
6099
|
+
}
|
|
6100
|
+
CSS.formatHSLA = formatHSLA;
|
|
6101
|
+
function _toTwoDigitHex(n) {
|
|
6102
|
+
const r = ( (n.toString(16)));
|
|
6103
|
+
return r.length !== 2 ? '0' + r : r;
|
|
6104
|
+
}
|
|
6105
|
+
function formatHex(color) {
|
|
6106
|
+
return `#${_toTwoDigitHex(color.rgba.r)}${_toTwoDigitHex(color.rgba.g)}${_toTwoDigitHex(color.rgba.b)}`;
|
|
6107
|
+
}
|
|
6108
|
+
CSS.formatHex = formatHex;
|
|
6109
|
+
function formatHexA(color, compact = false) {
|
|
6110
|
+
if (compact && color.rgba.a === 1) {
|
|
6111
|
+
return Color.Format.CSS.formatHex(color);
|
|
6112
|
+
}
|
|
6113
|
+
return `#${_toTwoDigitHex(color.rgba.r)}${_toTwoDigitHex(color.rgba.g)}${_toTwoDigitHex(color.rgba.b)}${_toTwoDigitHex(Math.round(color.rgba.a * 255))}`;
|
|
6114
|
+
}
|
|
6115
|
+
CSS.formatHexA = formatHexA;
|
|
6116
|
+
function format(color) {
|
|
6117
|
+
if (color.isOpaque()) {
|
|
6118
|
+
return Color.Format.CSS.formatHex(color);
|
|
6119
|
+
}
|
|
6120
|
+
return Color.Format.CSS.formatRGBA(color);
|
|
6121
|
+
}
|
|
6122
|
+
CSS.format = format;
|
|
6123
|
+
function parseHex(hex) {
|
|
6124
|
+
const length = hex.length;
|
|
6125
|
+
if (length === 0) {
|
|
6126
|
+
return null;
|
|
6127
|
+
}
|
|
6128
|
+
if (hex.charCodeAt(0) !== 35 ) {
|
|
6129
|
+
return null;
|
|
6130
|
+
}
|
|
6131
|
+
if (length === 7) {
|
|
6132
|
+
const r = 16 * _parseHexDigit(hex.charCodeAt(1)) + _parseHexDigit(hex.charCodeAt(2));
|
|
6133
|
+
const g = 16 * _parseHexDigit(hex.charCodeAt(3)) + _parseHexDigit(hex.charCodeAt(4));
|
|
6134
|
+
const b = 16 * _parseHexDigit(hex.charCodeAt(5)) + _parseHexDigit(hex.charCodeAt(6));
|
|
6135
|
+
return (
|
|
6136
|
+
(new Color( (new RGBA(r, g, b, 1))))
|
|
6137
|
+
);
|
|
6138
|
+
}
|
|
6139
|
+
if (length === 9) {
|
|
6140
|
+
const r = 16 * _parseHexDigit(hex.charCodeAt(1)) + _parseHexDigit(hex.charCodeAt(2));
|
|
6141
|
+
const g = 16 * _parseHexDigit(hex.charCodeAt(3)) + _parseHexDigit(hex.charCodeAt(4));
|
|
6142
|
+
const b = 16 * _parseHexDigit(hex.charCodeAt(5)) + _parseHexDigit(hex.charCodeAt(6));
|
|
6143
|
+
const a = 16 * _parseHexDigit(hex.charCodeAt(7)) + _parseHexDigit(hex.charCodeAt(8));
|
|
6144
|
+
return (
|
|
6145
|
+
(new Color( (new RGBA(r, g, b, a / 255))))
|
|
6146
|
+
);
|
|
6147
|
+
}
|
|
6148
|
+
if (length === 4) {
|
|
6149
|
+
const r = _parseHexDigit(hex.charCodeAt(1));
|
|
6150
|
+
const g = _parseHexDigit(hex.charCodeAt(2));
|
|
6151
|
+
const b = _parseHexDigit(hex.charCodeAt(3));
|
|
6152
|
+
return (
|
|
6153
|
+
(new Color( (new RGBA(16 * r + r, 16 * g + g, 16 * b + b))))
|
|
6154
|
+
);
|
|
6155
|
+
}
|
|
6156
|
+
if (length === 5) {
|
|
6157
|
+
const r = _parseHexDigit(hex.charCodeAt(1));
|
|
6158
|
+
const g = _parseHexDigit(hex.charCodeAt(2));
|
|
6159
|
+
const b = _parseHexDigit(hex.charCodeAt(3));
|
|
6160
|
+
const a = _parseHexDigit(hex.charCodeAt(4));
|
|
6161
|
+
return (
|
|
6162
|
+
(new Color(
|
|
6163
|
+
(new RGBA(16 * r + r, 16 * g + g, 16 * b + b, (16 * a + a) / 255))
|
|
6164
|
+
))
|
|
6165
|
+
);
|
|
6166
|
+
}
|
|
6167
|
+
return null;
|
|
6168
|
+
}
|
|
6169
|
+
CSS.parseHex = parseHex;
|
|
6170
|
+
function _parseHexDigit(charCode) {
|
|
6171
|
+
switch (charCode) {
|
|
6172
|
+
case 48 : return 0;
|
|
6173
|
+
case 49 : return 1;
|
|
6174
|
+
case 50 : return 2;
|
|
6175
|
+
case 51 : return 3;
|
|
6176
|
+
case 52 : return 4;
|
|
6177
|
+
case 53 : return 5;
|
|
6178
|
+
case 54 : return 6;
|
|
6179
|
+
case 55 : return 7;
|
|
6180
|
+
case 56 : return 8;
|
|
6181
|
+
case 57 : return 9;
|
|
6182
|
+
case 97 : return 10;
|
|
6183
|
+
case 65 : return 10;
|
|
6184
|
+
case 98 : return 11;
|
|
6185
|
+
case 66 : return 11;
|
|
6186
|
+
case 99 : return 12;
|
|
6187
|
+
case 67 : return 12;
|
|
6188
|
+
case 100 : return 13;
|
|
6189
|
+
case 68 : return 13;
|
|
6190
|
+
case 101 : return 14;
|
|
6191
|
+
case 69 : return 14;
|
|
6192
|
+
case 102 : return 15;
|
|
6193
|
+
case 70 : return 15;
|
|
6194
|
+
}
|
|
6195
|
+
return 0;
|
|
6196
|
+
}
|
|
6197
|
+
})(Format.CSS || (Format.CSS = {}))));
|
|
6198
|
+
})(Color.Format || (Color.Format = {}))));
|
|
6199
|
+
})(Color || (Color = {}))));
|
|
5716
6200
|
var _a, _b;
|
|
5717
6201
|
if (SnippetParser.prototype.text == null) {
|
|
5718
6202
|
SnippetParser.prototype.text = function (value) {
|
|
@@ -5722,6 +6206,7 @@ if (SnippetParser.prototype.text == null) {
|
|
|
5722
6206
|
else {
|
|
5723
6207
|
console.warn('Useless polyfill: SnippetParser');
|
|
5724
6208
|
}
|
|
6209
|
+
Object.defineProperties(Color$1.prototype, Object.getOwnPropertyDescriptors(Color.prototype));
|
|
5725
6210
|
Object.defineProperties(List$1.prototype, Object.getOwnPropertyDescriptors(List.prototype));
|
|
5726
6211
|
Object.defineProperties(WorkspaceFolder$1.prototype, Object.getOwnPropertyDescriptors(WorkspaceFolder.prototype));
|
|
5727
6212
|
Object.defineProperties(LanguagesRegistry$1.prototype, Object.getOwnPropertyDescriptors(LanguagesRegistry.prototype));
|