Skip to content

Commit d4a0fff

Browse files
committed
model [nfc]: s/streamColorSwatch/streamColorSwatchLight/
1 parent 867c28f commit d4a0fff

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

lib/api/model/model.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ class Subscription extends ZulipStream {
422422
// instead have chosen to put it in more UI-centered code, like in a custom
423423
// material [ColorScheme] class or something. But it works for now.
424424
ColorSwatch<StreamColor> colorSwatch() =>
425-
_swatch ??= streamColorSwatch(color);
425+
_swatch ??= streamColorSwatchLight(color);
426426

427427
@visibleForTesting
428428
@JsonKey(includeToJson: false)
@@ -465,7 +465,7 @@ class Subscription extends ZulipStream {
465465
/// such as the background of an unread count badge.
466466
///
467467
/// For the dark-mode colors, see [streamColorSwatchDark].
468-
ColorSwatch<StreamColor> streamColorSwatch(int base) {
468+
ColorSwatch<StreamColor> streamColorSwatchLight(int base) {
469469
final baseAsColor = Color(base);
470470

471471
final clamped20to75 = clampLchLightness(baseAsColor, 20, 75);
@@ -521,7 +521,7 @@ ColorSwatch<StreamColor> streamColorSwatch(int base) {
521521
/// Use this in UI code for colors related to [Subscription.color],
522522
/// such as the background of an unread count badge.
523523
///
524-
/// For the light-mode colors, see [streamColorSwatch].
524+
/// For the light-mode colors, see [streamColorSwatchLight].
525525
ColorSwatch<StreamColor> streamColorSwatchDark(int base) {
526526
final baseAsColor = Color(base);
527527

test/api/model/model_test.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,15 @@ void main() {
130130
[StreamColor.base].equals(const Color(0xffff0000));
131131
});
132132

133-
group('streamColorSwatch', () {
133+
group('streamColorSwatchLight', () {
134134
test('base', () {
135-
check(streamColorSwatch(0xffffffff))[StreamColor.base]
135+
check(streamColorSwatchLight(0xffffffff))[StreamColor.base]
136136
.equals(const Color(0xffffffff));
137137
});
138138

139139
test('unreadCountBadgeBackground', () {
140140
void runCheck(int base, Color expected) {
141-
check(streamColorSwatch(base))
141+
check(streamColorSwatchLight(base))
142142
[StreamColor.unreadCountBadgeBackground].equals(expected);
143143
}
144144

@@ -201,7 +201,7 @@ void main() {
201201

202202
test('iconOnPlainBackground', () {
203203
void runCheck(int base, Color expected) {
204-
check(streamColorSwatch(base))
204+
check(streamColorSwatchLight(base))
205205
[StreamColor.iconOnPlainBackground].equals(expected);
206206
}
207207

@@ -243,7 +243,7 @@ void main() {
243243

244244
test('iconOnBarBackground', () {
245245
void runCheck(int base, Color expected) {
246-
check(streamColorSwatch(base))
246+
check(streamColorSwatchLight(base))
247247
[StreamColor.iconOnBarBackground].equals(expected);
248248
}
249249

@@ -285,7 +285,7 @@ void main() {
285285

286286
test('barBackground', () {
287287
void runCheck(int base, Color expected) {
288-
check(streamColorSwatch(base))
288+
check(streamColorSwatchLight(base))
289289
[StreamColor.barBackground].equals(expected);
290290
}
291291

test/widgets/unread_count_badge_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ void main() {
3838
});
3939

4040
testWidgets('stream color', (WidgetTester tester) async {
41-
final swatch = streamColorSwatch(0xff76ce90);
41+
final swatch = streamColorSwatchLight(0xff76ce90);
4242
await prepare(tester, swatch);
4343
check(findBackgroundColor(tester)).equals(swatch[StreamColor.unreadCountBadgeBackground]!);
4444
});

0 commit comments

Comments
 (0)