private void configurePaint(DocumentData documentData, int parentAlpha, int indexInDocument) {
    if (colorCallbackAnimation != null) { // dynamic property takes priority
      fillPaint.setColor(colorCallbackAnimation.getValue());
    } else if (colorAnimation != null && isIndexInRangeSelection(indexInDocument)) {
      fillPaint.setColor(colorAnimation.getValue());
    } else { // fall back to the document color
      fillPaint.setColor(documentData.color);
    }

    if (strokeColorCallbackAnimation != null) {
      strokePaint.setColor(strokeColorCallbackAnimation.getValue());
    } else if (strokeColorAnimation != null && isIndexInRangeSelection(indexInDocument)) {
      strokePaint.setColor(strokeColorAnimation.getValue());
    } else {
      strokePaint.setColor(documentData.strokeColor);
    }

    // These opacity values are in the range 0 to 100
    int transformOpacity = transform.getOpacity() == null ? 100 : transform.getOpacity().getValue();
    int textRangeOpacity = opacityAnimation != null && isIndexInRangeSelection(indexInDocument) ? opacityAnimation.getValue() : 100;

    // This alpha value needs to be in the range 0 to 255 to be applied to the Paint instances.
    // We map the layer transform's opacity into that range and multiply it by the fractional opacity of the text range and the parent.
    int alpha = Math.round((transformOpacity * 255f / 100f)
        * (textRangeOpacity / 100f)
        * parentAlpha / 255f);
    fillPaint.setAlpha(alpha);
    strokePaint.setAlpha(alpha);

    if (strokeWidthCallbackAnimation != null) {
      strokePaint.setStrokeWidth(strokeWidthCallbackAnimation.getValue());
    } else if (strokeWidthAnimation != null && isIndexInRangeSelection(indexInDocument)) {
      strokePaint.setStrokeWidth(strokeWidthAnimation.getValue());
    } else {
      strokePaint.setStrokeWidth(documentData.strokeWidth * Utils.dpScale());
    }
  }
Configures the [fillPaint] and [strokePaint] used for drawing based on currently active text ranges.

@param parentAlpha A value from 0 to 255 indicating the alpha of the parented layer.
lottie/src/main/java/com/airbnb/lottie/model/layer/TextLayer.java