isValidGradient = (colors) => {
  return (
    colors.length > 2 &&
    colors.slice(1).every((color) => isValidHexColor(color))
  );
}
Check if the given string is a valid gradient.

@param {string[]} colors Array of colors.
@returns {boolean} True if the given string is a valid gradient.