Skip to content

Commit

Permalink
Fix FormatException when change foreground or background color (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
dab246 authored Jun 29, 2023
1 parent 11343c5 commit 13e2359
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/src/widgets/toolbar_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ class ToolbarWidgetState extends State<ToolbarWidget> {
}
debugPrint('ToolbarWidget::updateToolbar::colorList: $colorList');
//update the fore/back selected color if necessary
if (colorList[0] != null && colorList[0]!.isNotEmpty) {
if (colorList[0] != null && colorList[0]!.isNotEmpty && colorList[0]!.startsWith('rgb')) {
setState(mounted, this.setState, () {
var rgb = colorList[0]!.replaceAll('rgb(', '').replaceAll(')', '');
var rgbList = rgb.split(', ');
Expand All @@ -189,7 +189,7 @@ class ToolbarWidgetState extends State<ToolbarWidget> {
_foreColorSelected = Colors.black;
});
}
if (colorList[1] != null && colorList[1]!.isNotEmpty) {
if (colorList[1] != null && colorList[1]!.isNotEmpty && colorList[1]!.startsWith('rgb')) {
setState(mounted, this.setState, () {
var rgb = colorList[1]!.replaceAll('rgb(', '').replaceAll(')', '');
var rgbList = rgb.split(', ');
Expand Down

0 comments on commit 13e2359

Please sign in to comment.