/**
 * Returns the base color from a CSS gradient string.
 *
 * @param {string} gradient - The CSS gradient string.
 * @returns {string} The base color extracted from the gradient string, or the original gradient string if no base color was found.
 */
export function getBaseColorFromGradient(gradient: string): string {
  const match = gradient.match(/rgba?\([^)]+\)|#[A-Fa-f\d]{3,6}/);
  return match ? match[0] : gradient;
}
