@@ -5,35 +5,37 @@ import 'package:yaru/theme.dart';
5
5
import '../../extensions/build_context_x.dart' ;
6
6
import '../../extensions/theme_data_x.dart' ;
7
7
import '../player_model.dart' ;
8
+ import 'player_view.dart' ;
8
9
9
10
class PlayerColor extends StatelessWidget with WatchItMixin {
10
- const PlayerColor ({super .key, required this .size, required this .alpha});
11
+ const PlayerColor ({
12
+ super .key,
13
+ required this .size,
14
+ required this .alpha,
15
+ required this .position,
16
+ });
11
17
12
18
final Size size;
13
19
final double alpha;
20
+ final PlayerPosition position;
14
21
15
22
@override
16
23
Widget build (BuildContext context) {
17
24
final theme = context.theme;
18
25
final baseColor =
19
- watchPropertyValue ((PlayerModel m) => m.color? .withValues (alpha: 0.3 ));
26
+ watchPropertyValue ((PlayerModel m) => m.color? .withValues (alpha: 0.4 ));
20
27
21
- final color = baseColor ??
22
- theme.cardColor.scale (lightness: theme.isLight ? - 0.2 : 0.2 );
28
+ final color = (baseColor ?? theme.cardColor).scale (
29
+ lightness: theme.isLight ? - 0.1 : 0.2 ,
30
+ saturation: theme.isLight ? 0.9 : 0.5 ,
31
+ );
23
32
return Opacity (
24
- opacity: alpha * (theme.isLight ? 0.7 : 0.8 ) ,
33
+ opacity: alpha * 0.8 ,
25
34
child: Container (
26
35
width: size.width,
27
36
height: size.height,
28
37
decoration: BoxDecoration (
29
- gradient: LinearGradient (
30
- colors: [
31
- color.withValues (alpha: 0.02 ),
32
- color,
33
- ],
34
- begin: Alignment .topRight,
35
- end: Alignment .bottomLeft,
36
- ),
38
+ gradient: position.getGradient (color),
37
39
),
38
40
),
39
41
);
0 commit comments