Skip to content

Commit

Permalink
Fix brightness adjust matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
veloce committed Dec 19, 2024
1 parent 9b5e19c commit cf7bab2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/src/model/settings/board_preferences.dart
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class BoardPrefs with _$BoardPrefs implements Serializable {
const BoardPrefs._();

@Assert(
'brightness == null || brightness >= -0.5 && brightness <= 0.5, hue == null || hue >= -1 && hue <= 1',
'brightness == null || brightness >= -1.0 && brightness <= 1.0, hue == null || hue >= -1 && hue <= 1',
)
const factory BoardPrefs({
required PieceSet pieceSet,
Expand Down
4 changes: 2 additions & 2 deletions lib/src/view/settings/theme_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,8 @@ class _BodyState extends ConsumerState<_Body> {
PlatformListTile(
leading: const Icon(Icons.brightness_6),
title: Slider.adaptive(
min: -0.5,
max: 0.5,
min: -1.0,
max: 1.0,
value: brightness,
onChanged: (value) {
setState(() {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/widgets/change_colors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ List<double> _adjustMatrix({required double hue, required double brightness}) {
];
// dart format on
}
final brightnessValue = brightness <= 0 ? brightness * 255 : brightness * 100;
final brightnessValue = brightness <= 0 ? brightness * 100 : brightness * 100;
return List<double>.from(<double>[
0.213 + cos(hue) * 0.787 + sin(hue) * -0.213,
0.715 + cos(hue) * -0.715 + sin(hue) * -0.715,
Expand Down

0 comments on commit cf7bab2

Please sign in to comment.