function buildFill(flatStyle, prefix, context) {
  let evaluateColor;
  if (prefix + 'fill-pattern-src' in flatStyle) {
    evaluateColor = patternEvaluator(flatStyle, prefix + 'fill-', context);
  } else {
    if (flatStyle[prefix + 'fill-color'] === 'none') {
      // avoids hit detection
      return (context) => null;
    }

    evaluateColor = colorLikeEvaluator(
      flatStyle,
      prefix + 'fill-color',
      context,
    );
  }
  if (!evaluateColor) {
    return null;
  }

  const fill = new Fill();
  return function (context) {
    const color = evaluateColor(context);
    if (color === NO_COLOR) {
      return null;
    }
    fill.setColor(color);
    return fill;
  };
}
@param {FlatStyle} flatStyle The flat style.
@param {string} prefix The property prefix.
@param {ParsingContext} context The parsing context.
@return {FillEvaluator?} A function that evaluates to a fill.