fix: improve readability in callout

This commit is contained in:
Aman Negi 2023-07-31 17:48:43 +05:30 committed by GitHub
parent 266209caeb
commit 8c544bc8c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -132,7 +132,13 @@ class _CalloutBlockComponentWidgetState
if (colorString == null) {
return Colors.transparent;
}
return colorString.toColor();
final brightness = Theme.of(context).brightness;
final bool isDarkMode = brightness == Brightness.dark;
final Color bgColor = colorString.toColor();
return isDarkMode ? bgColor.withOpacity(0.3) : bgColor;
}
// get the emoji of the note block from the node's attributes or default to '📌'