import 'package:flutter/material.dart';

import 'config.dart';

class ColorResolver {
  final Color bg;
  final Color font;
  final Color border;

  ColorResolver(this.bg, this.font, this.border);
}

///返回颜色
ColorResolver resolveEffectColors(Color color, Effect effect) => switch (effect) {
  Effect.dark => ColorResolver(color, Colors.white, color),
  Effect.light => () {
    final pale = color.withValues(alpha: 0.2);
    return ColorResolver(pale, color, pale);
  }(), // 注意这里多了 ()，表示立即调用
  Effect.plain => ColorResolver(Colors.white, color, color),
};
