optColor method

  1. @protected
Color? optColor(
  1. MarkupContext context, {
  2. bool enableTagAttr = true,
})

Implementation

@protected
Color? optColor(MarkupContext context, {bool enableTagAttr = true}) {
  final colorMapper = this.colorMapper ?? context.colorMapper;
  if (enableTagAttr) {
    return context.getColorBy(
      tags,
      fallbackKey: 'color',
      colorMapper: colorMapper,
    );
  }
  return context.getColor('color', colorMapper);
}