diff --git a/CHANGELOG.md b/CHANGELOG.md index 033e22b7..6edfaedf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,4 +30,7 @@ * Fix insert image. ## [0.1.1] -* Fix cursor issue when undo. \ No newline at end of file +* Fix cursor issue when undo. + +## [0.1.2] +* Handle more text colors. \ No newline at end of file diff --git a/lib/widgets/text_line.dart b/lib/widgets/text_line.dart index b9aa195d..fec497e0 100644 --- a/lib/widgets/text_line.dart +++ b/lib/widgets/text_line.dart @@ -108,11 +108,107 @@ class TextLine extends StatelessWidget { } Color _hexStringToColor(String s) { - switch (s.toLowerCase()) { + switch (s) { case 'transparent': return Colors.transparent; case 'black': return Colors.black; + case 'black12': + return Colors.black12; + case 'black26': + return Colors.black26; + case 'black38': + return Colors.black38; + case 'black45': + return Colors.black45; + case 'black54': + return Colors.black54; + case 'black87': + return Colors.black87; + case 'white': + return Colors.white; + case 'white10': + return Colors.white10; + case 'white12': + return Colors.white12; + case 'white24': + return Colors.white24; + case 'white30': + return Colors.white30; + case 'white38': + return Colors.white38; + case 'white54': + return Colors.white54; + case 'white60': + return Colors.white60; + case 'white70': + return Colors.white70; + case 'red': + return Colors.red; + case 'redAccent': + return Colors.redAccent; + case 'amber': + return Colors.amber; + case 'amberAccent': + return Colors.amberAccent; + case 'yellow': + return Colors.yellow; + case 'yellowAccent': + return Colors.yellowAccent; + case 'teal': + return Colors.teal; + case 'tealAccent': + return Colors.tealAccent; + case 'purple': + return Colors.purple; + case 'purpleAccent': + return Colors.purpleAccent; + case 'pink': + return Colors.pink; + case 'pinkAccent': + return Colors.pinkAccent; + case 'orange': + return Colors.orange; + case 'orangeAccent': + return Colors.orangeAccent; + case 'deepOrange': + return Colors.deepOrange; + case 'deepOrangeAccent': + return Colors.deepOrangeAccent; + case 'indigo': + return Colors.indigo; + case 'indigoAccent': + return Colors.indigoAccent; + case 'lime': + return Colors.lime; + case 'limeAccent': + return Colors.limeAccent; + case 'grey': + return Colors.grey; + case 'blueGrey': + return Colors.blueGrey; + case 'green': + return Colors.green; + case 'greenAccent': + return Colors.greenAccent; + case 'lightGreen': + return Colors.lightGreen; + case 'lightGreenAccent': + return Colors.lightGreenAccent; + case 'blue': + return Colors.blue; + case 'blueAccent': + return Colors.blueAccent; + case 'lightBlue': + return Colors.lightBlue; + case 'lightBlueAccent': + return Colors.lightBlueAccent; + case 'cyan': + return Colors.cyan; + case 'cyanAccent': + return Colors.cyanAccent; + case 'brown': + return Colors.brown; } if (s.startsWith('rgba')) { diff --git a/pubspec.yaml b/pubspec.yaml index 2419950a..5bfef26a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_quill description: One client and affiliated collaborator of Flutter Quill is Bullet Journal App. -version: 0.1.1 +version: 0.1.2 #author: bulletjournal homepage: https://bulletjournal.us/home/index.html repository: https://github.com/singerdmx/flutter-quill.git