isValidHexColor = (hexColor) => {
  return new RegExp(
    /^([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{4})$/,
  ).test(hexColor);
}
Checks if a string is a valid hex color.

@param {string} hexColor String to check.
@returns {boolean} True if the given string is a valid hex color.