helper.js 276 B

123456789
  1. const hex = /^#[0-9a-fA-F]{3}([0-9a-fA-F]{3})?$/;
  2. export function colorPanStyle(bgColor) {
  3. return `width: 30px; height: 30px; border: 1px solid black; border-radius: 4px; background-color: ${bgColor}`;
  4. }
  5. export function isHexColor(value) {
  6. return hex.test(value);
  7. }