Add Dock captions and subtle blue icon glow
This commit is contained in:
@@ -18,10 +18,11 @@ void main() {
|
||||
backdropColor: Colors.white,
|
||||
preview: true,
|
||||
);
|
||||
final selected = _channel(resting, 46, 52, 0);
|
||||
// Sample beside the visible label, away from icon glow and glass rims.
|
||||
final selected = _channel(resting, 22, 52, 0);
|
||||
final base = _channel(resting, 160, 52, 0);
|
||||
expect(base - selected, greaterThan(20));
|
||||
expect((_channel(resting, 46, 52, 2) - selected).abs(), lessThan(12));
|
||||
expect((_channel(resting, 22, 52, 2) - selected).abs(), lessThan(12));
|
||||
final held = await _render(
|
||||
tester,
|
||||
GlassDock(selectedIndex: 0, onSelected: (_) {}),
|
||||
@@ -29,7 +30,7 @@ void main() {
|
||||
held: true,
|
||||
preview: true,
|
||||
);
|
||||
expect(_channel(held, 46, 52, 0) - selected, greaterThan(18));
|
||||
expect(_channel(held, 22, 52, 0) - selected, greaterThan(18));
|
||||
});
|
||||
testWidgets(
|
||||
'glass softens fine background detail without whitening its colour',
|
||||
@@ -60,9 +61,9 @@ void main() {
|
||||
);
|
||||
// Below the symbol and away from the rim, the selected lens should retain
|
||||
// this saturated cyan backdrop while applying the new resting grey tint.
|
||||
final red = _channel(pixels, 46, 52, 0);
|
||||
final green = _channel(pixels, 46, 52, 1);
|
||||
final blue = _channel(pixels, 46, 52, 2);
|
||||
final red = _channel(pixels, 22, 52, 0);
|
||||
final green = _channel(pixels, 22, 52, 1);
|
||||
final blue = _channel(pixels, 22, 52, 2);
|
||||
expect(red, lessThan(85));
|
||||
expect(green - red, greaterThan(95));
|
||||
expect(blue - red, greaterThan(140));
|
||||
@@ -80,7 +81,7 @@ void main() {
|
||||
);
|
||||
for (final start in [32, 160]) {
|
||||
final reds = [
|
||||
for (var x = start; x < start + 20; x++) _channel(pixels, x, 52, 0),
|
||||
for (var x = start; x < start + 20; x++) _channel(pixels, x, 60, 0),
|
||||
];
|
||||
final contrast =
|
||||
reds.reduce((a, b) => a > b ? a : b) -
|
||||
@@ -103,7 +104,7 @@ void main() {
|
||||
);
|
||||
for (final start in [24, 160]) {
|
||||
final reds = [
|
||||
for (var x = start; x < start + 40; x++) _channel(pixels, x, 52, 0),
|
||||
for (var x = start; x < start + 40; x++) _channel(pixels, x, 60, 0),
|
||||
];
|
||||
final contrast =
|
||||
reds.reduce((a, b) => a > b ? a : b) -
|
||||
|
||||
Reference in New Issue
Block a user