Skip to content

Commit 0e42733

Browse files
fix: update color property accessors to match Flutter's stable API
1 parent fcd46ba commit 0e42733

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/src/surveys/models/survey_appearance.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,9 @@ class SurveyAppearance {
113113
/// Uses the HSP (Highly Sensitive Perceived) color model for perceived brightness.
114114
/// This matches the algorithm used in posthog-js.
115115
static Color _getContrastingTextColor(Color color) {
116-
final r = color.red;
117-
final g = color.green;
118-
final b = color.blue;
116+
final r = color.r;
117+
final g = color.g;
118+
final b = color.b;
119119
// HSP equation for perceived brightness
120120
final hsp = sqrt(0.299 * (r * r) + 0.587 * (g * g) + 0.114 * (b * b));
121121
// Using 127.5 as threshold (same as JS)

0 commit comments

Comments
 (0)