Compare commits
3
Commits
fb701301d8
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f2c272e7a3 | ||
|
|
00031119ac | ||
|
|
1dc206c4b4 |
@@ -156,6 +156,20 @@ export enum XResourceIDs {
|
|||||||
//
|
//
|
||||||
submit,
|
submit,
|
||||||
|
|
||||||
|
//
|
||||||
|
print,
|
||||||
|
export_png,
|
||||||
|
export_svg,
|
||||||
|
export_csv,
|
||||||
|
zoom_in,
|
||||||
|
zoom_out,
|
||||||
|
zoom_selection,
|
||||||
|
x_axis,
|
||||||
|
y_axis,
|
||||||
|
xy_axis,
|
||||||
|
pan,
|
||||||
|
full_screen,
|
||||||
|
|
||||||
//
|
//
|
||||||
//#region Pagination ...
|
//#region Pagination ...
|
||||||
first,
|
first,
|
||||||
|
|||||||
@@ -104,8 +104,8 @@ export function parseXColor(color: XColorIdentifier): XColorDescribtor {
|
|||||||
const brightnessLevel: XColorBrightnessLevel = strColor.includes('tint')
|
const brightnessLevel: XColorBrightnessLevel = strColor.includes('tint')
|
||||||
? XColorBrightnessLevel.Tint
|
? XColorBrightnessLevel.Tint
|
||||||
: strColor.includes('shade')
|
: strColor.includes('shade')
|
||||||
? XColorBrightnessLevel.Shade
|
? XColorBrightnessLevel.Shade
|
||||||
: XColorBrightnessLevel.Regular;
|
: XColorBrightnessLevel.Regular;
|
||||||
const name = strColor
|
const name = strColor
|
||||||
.replace('-', '')
|
.replace('-', '')
|
||||||
.replace('contrast', '')
|
.replace('contrast', '')
|
||||||
@@ -409,8 +409,8 @@ export function stringToRGBA(value: string): XRGBAColor {
|
|||||||
value = value.includes('rgba')
|
value = value.includes('rgba')
|
||||||
? value.replace('rgba', '')
|
? value.replace('rgba', '')
|
||||||
: value.includes('rgb')
|
: value.includes('rgb')
|
||||||
? value.replace('rgb', '')
|
? value.replace('rgb', '')
|
||||||
: value;
|
: value;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Replace paranteses ...
|
// Replace paranteses ...
|
||||||
@@ -890,14 +890,14 @@ export function stringToHsva(colorString: string = ''): XHSVAColor {
|
|||||||
const type = isHEX(colorString)
|
const type = isHEX(colorString)
|
||||||
? 'hex'
|
? 'hex'
|
||||||
: isRGBA(colorString)
|
: isRGBA(colorString)
|
||||||
? 'rgba'
|
? 'rgba'
|
||||||
: isRGB(colorString)
|
: isRGB(colorString)
|
||||||
? 'rgb'
|
? 'rgb'
|
||||||
: isHSVA(colorString)
|
: isHSVA(colorString)
|
||||||
? 'hsva'
|
? 'hsva'
|
||||||
: isHSLA(colorString)
|
: isHSLA(colorString)
|
||||||
? 'hsla'
|
? 'hsla'
|
||||||
: 'unknown';
|
: 'unknown';
|
||||||
|
|
||||||
//
|
//
|
||||||
// get result value based on input type ...
|
// get result value based on input type ...
|
||||||
@@ -1179,3 +1179,37 @@ export function formatColor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve Specified Color Identifier Value ...
|
||||||
|
*
|
||||||
|
* @param color Color Identifier ...
|
||||||
|
*
|
||||||
|
* @returns an string value which represent color ...
|
||||||
|
*/
|
||||||
|
export function getXColorValue(color: XColorIdentifier) {
|
||||||
|
//
|
||||||
|
let result = '';
|
||||||
|
|
||||||
|
//
|
||||||
|
if (!isNullOrUndefined(color)) {
|
||||||
|
//
|
||||||
|
const descriptor = parseXColor(color);
|
||||||
|
if (!isNullOrUndefined(descriptor)) {
|
||||||
|
//
|
||||||
|
var colorCssVarName = getXColorCssVariableName(
|
||||||
|
descriptor.name,
|
||||||
|
descriptor.isContrast,
|
||||||
|
descriptor.brightnessLevel,
|
||||||
|
);
|
||||||
|
if (!isNullOrEmptyString(colorCssVarName)) {
|
||||||
|
//
|
||||||
|
const computedStyle = getComputedStyle(document.documentElement);
|
||||||
|
result = computedStyle.getPropertyValue(colorCssVarName.trim()).trim();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user