mirror of
https://github.com/elastic/kibana.git
synced 2025-04-25 02:09:32 -04:00
[Code]: remove uneccessary color convert after upgrade to EUI 9
This commit is contained in:
parent
6a1fc64c39
commit
57764f3dbd
3 changed files with 22 additions and 47 deletions
|
@ -39,7 +39,6 @@
|
||||||
"@types/angular": "1.6.50",
|
"@types/angular": "1.6.50",
|
||||||
"@types/boom": "^7.2.0",
|
"@types/boom": "^7.2.0",
|
||||||
"@types/cheerio": "^0.22.10",
|
"@types/cheerio": "^0.22.10",
|
||||||
"@types/color-convert": "^1.9.0",
|
|
||||||
"@types/d3-array": "^1.2.1",
|
"@types/d3-array": "^1.2.1",
|
||||||
"@types/d3-scale": "^2.0.0",
|
"@types/d3-scale": "^2.0.0",
|
||||||
"@types/d3-shape": "^1.3.1",
|
"@types/d3-shape": "^1.3.1",
|
||||||
|
@ -191,7 +190,6 @@
|
||||||
"brace": "0.11.1",
|
"brace": "0.11.1",
|
||||||
"chroma-js": "^1.3.6",
|
"chroma-js": "^1.3.6",
|
||||||
"classnames": "2.2.5",
|
"classnames": "2.2.5",
|
||||||
"color-convert": "^2.0.0",
|
|
||||||
"concat-stream": "1.5.1",
|
"concat-stream": "1.5.1",
|
||||||
"constate": "^0.9.0",
|
"constate": "^0.9.0",
|
||||||
"constate-latest": "npm:constate@^1.0.0",
|
"constate-latest": "npm:constate@^1.0.0",
|
||||||
|
|
|
@ -119,44 +119,28 @@ const IS_DARK_THEME = chrome.getUiSettingsClient().get('theme:darkMode');
|
||||||
},
|
},
|
||||||
};*/
|
};*/
|
||||||
|
|
||||||
function getTheme() {
|
const themeName = IS_DARK_THEME ? darkTheme : lightTheme;
|
||||||
if (IS_DARK_THEME) {
|
|
||||||
return darkTheme;
|
|
||||||
} else {
|
|
||||||
return lightTheme;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const themeName = getTheme();
|
|
||||||
|
|
||||||
function getHex(rgbString: string) {
|
|
||||||
const colorValues = rgbString.slice(4, -1);
|
|
||||||
const colorArray = colorValues.split(', ');
|
|
||||||
|
|
||||||
// @ts-ignore
|
|
||||||
return '#' + convert.rgb.hex(Number(colorArray[0]), Number(colorArray[1]), Number(colorArray[2]));
|
|
||||||
}
|
|
||||||
|
|
||||||
const syntaxTheme = {
|
const syntaxTheme = {
|
||||||
keyword: getHex(themeName.euiColorAccent),
|
keyword: themeName.euiColorAccent,
|
||||||
comment: getHex(themeName.euiColorMediumShade),
|
comment: themeName.euiColorMediumShade,
|
||||||
delimiter: getHex(themeName.euiColorSecondary),
|
delimiter: themeName.euiColorSecondary,
|
||||||
string: getHex(themeName.euiColorPrimary),
|
string: themeName.euiColorPrimary,
|
||||||
number: getHex(themeName.euiColorWarning),
|
number: themeName.euiColorWarning,
|
||||||
regexp: getHex(themeName.euiColorPrimary),
|
regexp: themeName.euiColorPrimary,
|
||||||
types: `${IS_DARK_THEME ? getHex(themeName.euiColorVis5) : getHex(themeName.euiColorVis9)}`,
|
types: `${IS_DARK_THEME ? themeName.euiColorVis5 : themeName.euiColorVis9}`,
|
||||||
annotation: getHex(themeName.euiColorLightShade),
|
annotation: themeName.euiColorLightShade,
|
||||||
tag: getHex(themeName.euiColorAccent),
|
tag: themeName.euiColorAccent,
|
||||||
symbol: getHex(themeName.euiColorDanger),
|
symbol: themeName.euiColorDanger,
|
||||||
foreground: getHex(themeName.euiColorDarkestShade),
|
foreground: themeName.euiColorDarkestShade,
|
||||||
editorBackground: getHex(themeName.euiColorLightestShade),
|
editorBackground: themeName.euiColorLightestShade,
|
||||||
lineNumbers: getHex(themeName.euiColorDarkShade),
|
lineNumbers: themeName.euiColorDarkShade,
|
||||||
editorIndentGuide: getHex(themeName.euiColorLightShade),
|
editorIndentGuide: themeName.euiColorLightShade,
|
||||||
selectionBackground: getHex(themeName.euiColorLightShade),
|
selectionBackground: themeName.euiColorLightShade,
|
||||||
editorWidgetBackground: getHex(themeName.euiColorLightestShade),
|
editorWidgetBackground: themeName.euiColorLightestShade,
|
||||||
editorWidgetBorder: getHex(themeName.euiColorLightShade),
|
editorWidgetBorder: themeName.euiColorLightShade,
|
||||||
findMatchBackground: getHex(themeName.euiColorWarning),
|
findMatchBackground: themeName.euiColorWarning,
|
||||||
findMatchHighlightBackground: getHex(themeName.euiColorWarning),
|
findMatchHighlightBackground: themeName.euiColorWarning,
|
||||||
};
|
};
|
||||||
|
|
||||||
monaco.editor.defineTheme('euiColors', {
|
monaco.editor.defineTheme('euiColors', {
|
||||||
|
|
11
yarn.lock
11
yarn.lock
|
@ -1719,7 +1719,7 @@
|
||||||
resolved "https://registry.yarnpkg.com/@types/cmd-shim/-/cmd-shim-2.0.0.tgz#c3d81d3c2a51af3c65c19b4f1d493a75abf07a5c"
|
resolved "https://registry.yarnpkg.com/@types/cmd-shim/-/cmd-shim-2.0.0.tgz#c3d81d3c2a51af3c65c19b4f1d493a75abf07a5c"
|
||||||
integrity sha512-WuV5bOQTGxqzewPnJbrDe51I5mnX2wTRYy+PduRuIvSuBWZlxDYD6Qt/f1m5sezxx1yyE9+1wHJ/0sRuNIoFaQ==
|
integrity sha512-WuV5bOQTGxqzewPnJbrDe51I5mnX2wTRYy+PduRuIvSuBWZlxDYD6Qt/f1m5sezxx1yyE9+1wHJ/0sRuNIoFaQ==
|
||||||
|
|
||||||
"@types/color-convert@*", "@types/color-convert@^1.9.0":
|
"@types/color-convert@*":
|
||||||
version "1.9.0"
|
version "1.9.0"
|
||||||
resolved "https://registry.yarnpkg.com/@types/color-convert/-/color-convert-1.9.0.tgz#bfa8203e41e7c65471e9841d7e306a7cd8b5172d"
|
resolved "https://registry.yarnpkg.com/@types/color-convert/-/color-convert-1.9.0.tgz#bfa8203e41e7c65471e9841d7e306a7cd8b5172d"
|
||||||
integrity sha512-OKGEfULrvSL2VRbkl/gnjjgbbF7ycIlpSsX7Nkab4MOWi5XxmgBYvuiQ7lcCFY5cPDz7MUNaKgxte2VRmtr4Fg==
|
integrity sha512-OKGEfULrvSL2VRbkl/gnjjgbbF7ycIlpSsX7Nkab4MOWi5XxmgBYvuiQ7lcCFY5cPDz7MUNaKgxte2VRmtr4Fg==
|
||||||
|
@ -6754,19 +6754,12 @@ color-convert@^1.9.1:
|
||||||
dependencies:
|
dependencies:
|
||||||
color-name "1.1.3"
|
color-name "1.1.3"
|
||||||
|
|
||||||
color-convert@^2.0.0:
|
|
||||||
version "2.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.0.tgz#9851ac61cc0d3898a8a3088650d5bf447bf69d97"
|
|
||||||
integrity sha512-hzTicsCJIHdxih9+2aLR1tNGZX5qSJGRHDPVwSY26tVrEf55XNajLOBWz2UuWSIergszA09/bqnOiHyqx9fxQg==
|
|
||||||
dependencies:
|
|
||||||
color-name "~1.1.4"
|
|
||||||
|
|
||||||
color-name@1.1.3:
|
color-name@1.1.3:
|
||||||
version "1.1.3"
|
version "1.1.3"
|
||||||
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25"
|
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25"
|
||||||
integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=
|
integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=
|
||||||
|
|
||||||
color-name@^1.0.0, color-name@^1.1.1, color-name@~1.1.4:
|
color-name@^1.0.0, color-name@^1.1.1:
|
||||||
version "1.1.4"
|
version "1.1.4"
|
||||||
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
|
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
|
||||||
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
|
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue