File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -68,10 +68,10 @@ class _ColorBoxState extends State<ColorBox> {
68
68
// Copy color as hex to clipboard
69
69
final c = widget.color;
70
70
71
- String hex = '#' ;
72
- hex += colorChannelToHex (c.r);
73
- hex += colorChannelToHex (c.g);
74
- hex += colorChannelToHex (c.b);
71
+ final hex =
72
+ '#${ _colorChannelToHex (c .r )}'
73
+ '${ _colorChannelToHex (c .g )}'
74
+ '${ _colorChannelToHex (c .b )}' ;
75
75
76
76
final data = ClipboardData (text: hex);
77
77
await Clipboard .setData (data);
@@ -88,9 +88,9 @@ class _ColorBoxState extends State<ColorBox> {
88
88
),
89
89
);
90
90
}
91
+ }
91
92
92
- String colorChannelToHex (double value) {
93
- final intVal = (value * 255 ).round ();
94
- return intVal.toRadixString (16 ).padLeft (2 , '0' );
95
- }
93
+ String _colorChannelToHex (double value) {
94
+ final intVal = (value * 255 ).round ();
95
+ return intVal.toRadixString (16 ).padLeft (2 , '0' );
96
96
}
You can’t perform that action at this time.
0 commit comments