function asColorLike(color) {
  if (!color) {
    return null;
  }
  if (Array.isArray(color)) {
    return toString(color);
  }
  if (typeof color === 'object' && 'src' in color) {
    return asCanvasPattern(color);
  }
  return color;
}
@param {import("./color.js").Color|ColorLike|PatternDescriptor|null} color Color.
@return {ColorLike|null} The color as an {@link ol/colorlike~ColorLike}.
@api