Skip to content
Snippets Groups Projects
Commit fc85a23d authored by cociugsergiu's avatar cociugsergiu
Browse files

fix: small default color correction

parent 73c03796
No related branches found
No related tags found
No related merge requests found
......@@ -15,14 +15,17 @@ import {
import brandConfig from '../brandConfig.json'
const validateInstanceConfigColors = (colorCode) => {
const defaultInstanceColor = '#2fca66';
const hexaDecimalRegex = /^#[0-9A-F]{6}$/i;
const shortHexaDecimalRegex = /^#([0-9A-F]{3}){1,2}$/i;
const validateInstanceConfigColors = colorCode => {
const defaultInstanceColor = '#2fac66'
const hexaDecimalRegex = /^#[0-9A-F]{6}$/i
const shortHexaDecimalRegex = /^#([0-9A-F]{3}){1,2}$/i
if (colorCode.length <= 4) {
return colorCode.match(shortHexaDecimalRegex) ? colorCode : defaultInstanceColor
return colorCode.match(shortHexaDecimalRegex)
? colorCode
: defaultInstanceColor
}
return colorCode.match(hexaDecimalRegex) ? colorCode : defaultInstanceColor
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment