contrastColorTrans function

Color contrastColorTrans(
  1. Color color, {
  2. double blackOpacity = 0.12,
  3. double whiteOpacity = 0.24,
  4. double threshold = 0.15,
})

Implementation

Color contrastColorTrans(
  Color color, {
  double blackOpacity = 0.12,
  double whiteOpacity = 0.24,
  double threshold = 0.15,
}) {
  return isDark(color, threshold: threshold)
      ? const Color(0xffffffff).withOpacity(whiteOpacity)
      : const Color(0xff000000).withOpacity(blackOpacity);
}