5 lines
111 B
JavaScript
5 lines
111 B
JavaScript
|
export const isHexColor = (str) => {
|
||
|
const pattern = /^#([0-9A-F]{3}){1,2}$/i;
|
||
|
return pattern.test(str);
|
||
|
}
|