Skip to content

Commit

Permalink
More work on opacity source colors, when opacity is not enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
rydmike committed Mar 1, 2024
1 parent aac1e93 commit 546e577
Show file tree
Hide file tree
Showing 14 changed files with 982 additions and 1,025 deletions.
159 changes: 50 additions & 109 deletions CHANGELOG.md

Large diffs are not rendered by default.

1,188 changes: 589 additions & 599 deletions coverage/lcov.info

Large diffs are not rendered by default.

7 changes: 0 additions & 7 deletions example/lib/demo/pods/pods.dart
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,6 @@ final StateProvider<bool> enableOpacityPod =
defaultValue: Keys.defaults[Keys.enableOpacity]! as bool) as bool;
}, name: Keys.enableOpacity);

// State of enabling transparency for custom colors.
final StateProvider<bool> enableTransparencyPod =
StateProvider<bool>((StateProviderRef<bool> ref) {
return hiveStore.get(Keys.enableTransparency,
defaultValue: Keys.defaults[Keys.enableTransparency]! as bool) as bool;
}, name: Keys.enableTransparency);

// State of showing Material color name.
final StateProvider<bool> showMaterialNamePod =
StateProvider<bool>((StateProviderRef<bool> ref) {
Expand Down
3 changes: 0 additions & 3 deletions example/lib/demo/pods/pods_reset.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ void resetSettings(WidgetRef ref) {
ref.read(enableOpacityPod.notifier).state =
Keys.defaults[Keys.enableOpacity]! as bool;

ref.read(enableTransparencyPod.notifier).state =
Keys.defaults[Keys.enableTransparency]! as bool;

ref.read(showMaterialNamePod.notifier).state =
Keys.defaults[Keys.showMaterialName]! as bool;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ class ColorPickerCard extends ConsumerWidget {
hasBorder: ref.watch(hasBorderPod),
borderRadius: ref.watch(borderRadiusPod),
columnSpacing: ref.watch(columnSpacingPod),
toolbarSpacing: 0,
wheelDiameter: ref.watch(wheelDiameterPod),
wheelWidth: ref.watch(wheelWidthPod),
wheelSquarePadding: ref.watch(wheelSquarePaddingPod),
Expand Down Expand Up @@ -126,7 +127,6 @@ class ColorPickerCard extends ConsumerWidget {
showRecentColors: ref.watch(showRecentColorsPod),
recentColors: ref.watch(cardRecentColorsPod),
maxRecentColors: 8,
enableTransparentCustomColors: ref.watch(enableTransparencyPod),
customColorSwatchesAndNames: App.colorsNameMap,
customSecondaryColorSwatchesAndNames: App.colorsOptionsMap,
colorCodeTextStyle: Theme.of(context).textTheme.titleMedium,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ Future<bool> colorPickerDialog(
hasBorder: ref.watch(hasBorderPod),
borderRadius: ref.watch(borderRadiusPod),
columnSpacing: ref.watch(columnSpacingPod),
toolbarSpacing: 0,
wheelDiameter: ref.watch(wheelDiameterPod),
wheelWidth: ref.watch(wheelWidthPod),
wheelHasBorder: ref.watch(wheelHasBorderPod),
Expand Down Expand Up @@ -143,7 +144,6 @@ Future<bool> colorPickerDialog(
? ref.watch(cardRecentColorsPod)
: ref.watch(dialogRecentColorsPod),
maxRecentColors: cardRemote ? 8 : 5,
enableTransparentCustomColors: ref.watch(enableTransparencyPod),
customColorSwatchesAndNames: App.colorsNameMap,
customSecondaryColorSwatchesAndNames: App.colorsOptionsMap,
).showPickerDialog(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import 'about.dart';
import 'all_control_widgets.dart';
import 'color_picker_card.dart';
import 'picker_switches/dialog_action_only_ok_button_switch.dart';
import 'picker_switches/transparency_switch.dart';
import 'picker_text_fields/text_field_focus_demo.dart';
import 'picker_toggle_buttons/actions_order_switch.dart';

Expand Down Expand Up @@ -235,7 +234,6 @@ class _Column2 extends StatelessWidget {
const Index850Switch(),
const TonalSwitch(),
const OpacitySwitch(),
const TransparencySwitch(),
const Divider(),
//
const MaterialNameSwitch(),
Expand Down

This file was deleted.

26 changes: 13 additions & 13 deletions example/lib/demo/utils/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class App {
static const Color trendyPink = Color(0xFF9565A5);
static const Color parsley = Color(0xFF16552C);
static const Color walnut = Color(0xFF753D1F);
static const Color parsleyOpacity = Color(0x4416552C);
static const Color parsleyOpacity = Color(0x5516552C);

// Add a custom white to black grey scale.
static const MaterialColor whiteBlueBlack = MaterialColor(
Expand Down Expand Up @@ -116,20 +116,20 @@ class App {
},
);

// Add a custom white to black grey scale.
// Add a custom parsley swatch
static const MaterialColor allSwatchParsleyTransparent = MaterialColor(
0x8830874C, // Set the 500 index value here.
0x9930874C, // Set the 500 index value here.
<int, Color>{
50: Color(0x88ADF3B9),
100: Color(0x88ADF3B9),
200: Color(0x8882D995),
300: Color(0x8867BD7C),
400: Color(0x884CA164),
500: Color(0x8830874C),
600: Color(0x880C6D35),
700: Color(0x88005226),
800: Color(0x88003918),
900: Color(0x8800210B),
50: Color(0x99F5FFF2),
100: Color(0x99ADF3B9),
200: Color(0x9982D995),
300: Color(0x9967BD7C),
400: Color(0x994CA164),
500: Color(0x9930874C),
600: Color(0x990C6D35),
700: Color(0x99005226),
800: Color(0x99003918),
900: Color(0x9900210B),
},
);

Expand Down
Loading

0 comments on commit 546e577

Please sign in to comment.