Improve accessibility contrast for pre-test message (#180469)

Fixes https://github.com/flutter/flutter/issues/179181

The pre-test message "Test starting..." previously had a contrast ratio
of 2.99:1 against the background, which is below the recommended 3:1
minimum for accessibility.

This PR slightly adjusts the text color from 0xFF917FFF to 0xFF8F7FFF
to meet the minimum contrast requirement while preserving the visual
appearance.
This commit is contained in:
Ashok Narayan 2026-02-06 02:52:24 +05:30 committed by GitHub
parent 60e001eeaa
commit 3e034fce05
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 1 deletions

View File

@ -1505,7 +1505,7 @@ abstract class TestWidgetsFlutterBinding extends BindingBase
return announcements;
}
static const TextStyle _messageStyle = TextStyle(color: Color(0xFF917FFF), fontSize: 40.0);
static const TextStyle _messageStyle = TextStyle(color: Color(0xFF8F7FFF), fontSize: 40.0);
static const Widget _preTestMessage = Center(
child: Text('Test starting...', style: _messageStyle, textDirection: TextDirection.ltr),

View File

@ -0,0 +1,15 @@
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter_test/flutter_test.dart';
void main() {
/// Verifies that the pre-test message shown by flutter_test
/// meets the minimum WCAG text contrast accessibility guideline.
testWidgets('pre-test message meets text contrast guideline', (WidgetTester tester) async {
// The pre-test message is already attached to the render tree by the
// TestWidgetsFlutterBinding before this test runs, so no pumpWidget is needed.
await expectLater(tester, meetsGuideline(textContrastGuideline));
});
}