diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml new file mode 100644 index 0000000..c8a13ba --- /dev/null +++ b/.github/workflows/continuous_integration.yml @@ -0,0 +1,64 @@ +name: Continuous Integration + +on: [push, pull_request] + +jobs: + check: + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: '12.x' + - uses: subosito/flutter-action@v1 + with: + channel: 'stable' + - name: Get dependencies + run: flutter pub get + - name: Verify source code is formatted + run: flutter format --set-exit-if-changed . + - name: Verify there are no analyzer errors + run: flutter analyze --fatal-infos --fatal-warnings . + - name: Verify all tests pass + run: flutter test --coverage + - name: Verify example app builds + run: cd example && flutter build web + - uses: codecov/codecov-action@v1.0.0 + name: Upload coverage to codecov.io + with: + flags: unittests + file: coverage/lcov.info + token: ${{ secrets.CODECOV_TOKEN }} + + publish: + runs-on: ubuntu-latest + timeout-minutes: 5 + needs: [check] + if: github.ref == 'refs/heads/main' + # Continue on error doesn't seem to work? + # Using || true for publishing + # continue-on-error: true + steps: + - uses: actions/checkout@v2 + - name: Install Dart + run: | + sudo apt-get update + sudo apt-get install apt-transport-https + sudo sh -c 'wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -' + sudo sh -c 'wget -qO- https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list' + sudo apt-get update + sudo apt-get install dart + export PATH="$PATH:/usr/lib/dart/bin" + - name: Setup credentials + run: | + mkdir -p ~/.pub-cache + echo ${{ secrets.PUB_CREDENTIALS_JSON }} > ~/.pub-cache/credentials.json + - name: Publish the package + run: | + export version=v$(grep "version: " pubspec.yaml | cut -c 10-) + dart pub publish --force && (git tag $version && git push origin $version && gh release create $version) || true + env: + GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} + - name: Delete credentials + run: rm ~/.pub-cache/credentials.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..db88d5a --- /dev/null +++ b/.gitignore @@ -0,0 +1,76 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +build/ + +# Android related +**/android/**/gradle-wrapper.jar +**/android/.gradle +**/android/captures/ +**/android/gradlew +**/android/gradlew.bat +**/android/local.properties +**/android/**/GeneratedPluginRegistrant.java + +# iOS/XCode related +**/ios/**/*.mode1v3 +**/ios/**/*.mode2v3 +**/ios/**/*.moved-aside +**/ios/**/*.pbxuser +**/ios/**/*.perspectivev3 +**/ios/**/*sync/ +**/ios/**/.sconsign.dblite +**/ios/**/.tags* +**/ios/**/.vagrant/ +**/ios/**/DerivedData/ +**/ios/**/Icon? +**/ios/**/Pods/ +**/ios/**/.symlinks/ +**/ios/**/profile +**/ios/**/xcuserdata +**/ios/.generated/ +**/ios/Flutter/App.framework +**/ios/Flutter/Flutter.framework +**/ios/Flutter/Flutter.podspec +**/ios/Flutter/Generated.xcconfig +**/ios/Flutter/ephemeral +**/ios/Flutter/app.flx +**/ios/Flutter/app.zip +**/ios/Flutter/flutter_assets/ +**/ios/Flutter/flutter_export_environment.sh +**/ios/ServiceDefinitions.json +**/ios/Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!**/ios/**/default.mode1v3 +!**/ios/**/default.mode2v3 +!**/ios/**/default.pbxuser +!**/ios/**/default.perspectivev3 +coverage/ diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..1d4801a --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,3 @@ +## 0.2.0+3 + +Initial release, set up CI/CD and code coverage, etc. diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..731a737 --- /dev/null +++ b/LICENSE @@ -0,0 +1,9 @@ +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..7e447d2 --- /dev/null +++ b/README.md @@ -0,0 +1,39 @@ +# `kolors` + +> The named HTML colors that you can use in your Flutter apps. + +HTML and CSS lets you use around 140 names colors. With this simple Flutter package, you can now access these colors also from your Flutter app. + +[![Continuous Integration](https://github.com/dartsidedev/kolors/workflows/Continuous%20Integration/badge.svg?branch=main)](https://github.com/dartsidedev/kolors/actions) [![codecov](https://codecov.io/gh/dartsidedev/kolors/branch/main/graph/badge.svg)](https://codecov.io/gh/dartsidedev/kolors) [![kolors](https://img.shields.io/pub/v/kolors?label=kolors&logo=dart)](https://pub.dev/packages/kolors 'See kolors package info on pub.dev') [![Published by dartside.dev](https://img.shields.io/static/v1?label=Published%20by&message=dartside.dev&logo=dart&logoWidth=30&color=40C4FF&labelColor=1d599b&labelWidth=100)](https://pub.dev/publishers/dartside.dev/packages) [![GitHub Stars Count](https://img.shields.io/github/stars/dartsidedev/kolors?logo=github)](https://github.com/dartsidedev/kolors 'Star me on GitHub!') + +## Important links + +* [Read the source code and **star the repo** on GitHub](https://github.com/dartsidedev/kolors) +* [Open an issue on GitHub](https://github.com/dartsidedev/kolors/issues) +* [See package on `pub.dev`](https://pub.dev/packages/kolors) +* [Read the docs on `pub.dev`](https://pub.dev/documentation/kolors/latest/) + +## Usage + +```dart +import 'package:kolors/kolors.dart'; + +// If you want to show the colors with their names to your users, +// use the "asMap" that contains the colors names and the colors. +final m = Kolors.asMap(); +final entries = m.entries.toList(growable: false); + +// Just type "Kolors." and pick a color that you like. +const appBarColor = Kolors.tomato; + +// You can use the grouped classes if you know which color's shades +// you are interested in. +const fabColor = KolorBlues.skyBlue; +``` + +TODO: demo app gif +TODO: demo IntelliJ + +You can find the example app on GitHub and on pub.dev. + +Please keep in mind that this package has a `dart:ui` dependency (and [therefore runs only with Flutter](https://twitter.com/vincevargadev/status/1471965783463010311)). \ No newline at end of file diff --git a/analysis_options.yaml b/analysis_options.yaml new file mode 100644 index 0000000..f9b3034 --- /dev/null +++ b/analysis_options.yaml @@ -0,0 +1 @@ +include: package:flutter_lints/flutter.yaml diff --git a/example/.gitignore b/example/.gitignore new file mode 100644 index 0000000..0fa6b67 --- /dev/null +++ b/example/.gitignore @@ -0,0 +1,46 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +/build/ + +# Web related +lib/generated_plugin_registrant.dart + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release diff --git a/example/.metadata b/example/.metadata new file mode 100644 index 0000000..71a1778 --- /dev/null +++ b/example/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: 65cf7de5f45140010a5d2989f5abbbf530708a6b + channel: beta + +project_type: app diff --git a/example/README.md b/example/README.md new file mode 100644 index 0000000..1b8ed45 --- /dev/null +++ b/example/README.md @@ -0,0 +1,3 @@ +# example + +An example project for demonstrating how the kolors package works. \ No newline at end of file diff --git a/example/analysis_options.yaml b/example/analysis_options.yaml new file mode 100644 index 0000000..61b6c4d --- /dev/null +++ b/example/analysis_options.yaml @@ -0,0 +1,29 @@ +# This file configures the analyzer, which statically analyzes Dart code to +# check for errors, warnings, and lints. +# +# The issues identified by the analyzer are surfaced in the UI of Dart-enabled +# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be +# invoked from the command line by running `flutter analyze`. + +# The following line activates a set of recommended lints for Flutter apps, +# packages, and plugins designed to encourage good coding practices. +include: package:flutter_lints/flutter.yaml + +linter: + # The lint rules applied to this project can be customized in the + # section below to disable rules from the `package:flutter_lints/flutter.yaml` + # included above or to enable additional rules. A list of all available lints + # and their documentation is published at + # https://dart-lang.github.io/linter/lints/index.html. + # + # Instead of disabling a lint rule for the entire project in the + # section below, it can also be suppressed for a single line of code + # or a specific dart file by using the `// ignore: name_of_lint` and + # `// ignore_for_file: name_of_lint` syntax on the line or in the file + # producing the lint. + rules: + # avoid_print: false # Uncomment to disable the `avoid_print` rule + # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/example/lib/main.dart b/example/lib/main.dart new file mode 100644 index 0000000..6129a21 --- /dev/null +++ b/example/lib/main.dart @@ -0,0 +1,47 @@ +import 'package:flutter/material.dart'; +import 'package:kolors/kolors.dart'; + +void main() => runApp(const MyApp()); + +class MyApp extends StatelessWidget { + const MyApp({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + // If you want to show the colors with their names to your users, + // use the "asMap" that contains the colors names and the colors. + final m = Kolors.asMap(); + final entries = m.entries.toList(growable: false); + + // Just type "Kolors." and pick a color that you like. + const appBarColor = Kolors.tomato; + + // You can use the grouped classes if you know which color's shades + // you are interested in. + const fabColor = KolorBlues.skyBlue; + + return MaterialApp( + title: 'Flutter Demo', + debugShowCheckedModeBanner: false, + home: Scaffold( + appBar: AppBar( + title: const Text('HTML Colors'), + backgroundColor: appBarColor, + ), + floatingActionButton: FloatingActionButton( + onPressed: () {}, + tooltip: 'Do nothing', + child: const Icon(Icons.ac_unit), + backgroundColor: fabColor, + ), + body: ListView.builder( + itemCount: entries.length, + itemBuilder: (_, i) => ListTile( + tileColor: entries[i].value, + title: Text(entries[i].key), + ), + ), + ), + ); + } +} diff --git a/example/pubspec.lock b/example/pubspec.lock new file mode 100644 index 0000000..4d7600d --- /dev/null +++ b/example/pubspec.lock @@ -0,0 +1,175 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + async: + dependency: transitive + description: + name: async + url: "https://pub.dartlang.org" + source: hosted + version: "2.8.1" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + characters: + dependency: transitive + description: + name: characters + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + charcode: + dependency: transitive + description: + name: charcode + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.1" + clock: + dependency: transitive + description: + name: clock + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + collection: + dependency: transitive + description: + name: collection + url: "https://pub.dartlang.org" + source: hosted + version: "1.15.0" + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.4" + fake_async: + dependency: transitive + description: + name: fake_async + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.4" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + kolors: + dependency: "direct main" + description: + path: ".." + relative: true + source: path + version: "0.1.0" + lints: + dependency: transitive + description: + name: lints + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + matcher: + dependency: transitive + description: + name: matcher + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.10" + meta: + dependency: transitive + description: + name: meta + url: "https://pub.dartlang.org" + source: hosted + version: "1.7.0" + path: + dependency: transitive + description: + name: path + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.0" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_span: + dependency: transitive + description: + name: source_span + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.1" + stack_trace: + dependency: transitive + description: + name: stack_trace + url: "https://pub.dartlang.org" + source: hosted + version: "1.10.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + string_scanner: + dependency: transitive + description: + name: string_scanner + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + test_api: + dependency: transitive + description: + name: test_api + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.2" + typed_data: + dependency: transitive + description: + name: typed_data + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0" + vector_math: + dependency: transitive + description: + name: vector_math + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" +sdks: + dart: ">=2.12.0 <3.0.0" + flutter: ">=1.17.0" diff --git a/example/pubspec.yaml b/example/pubspec.yaml new file mode 100644 index 0000000..8a74452 --- /dev/null +++ b/example/pubspec.yaml @@ -0,0 +1,19 @@ +name: example +description: An example project for demonstrating how the kolors package works. +publish_to: 'none' +version: 1.0.0+1 +environment: + sdk: ">=2.12.0 <3.0.0" +dependencies: + flutter: + sdk: flutter + cupertino_icons: ^1.0.2 + kolors: + path: ../ + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^1.0.0 +flutter: + uses-material-design: true diff --git a/example/web/favicon.png b/example/web/favicon.png new file mode 100644 index 0000000..8aaa46a Binary files /dev/null and b/example/web/favicon.png differ diff --git a/example/web/icons/Icon-192.png b/example/web/icons/Icon-192.png new file mode 100644 index 0000000..b749bfe Binary files /dev/null and b/example/web/icons/Icon-192.png differ diff --git a/example/web/icons/Icon-512.png b/example/web/icons/Icon-512.png new file mode 100644 index 0000000..88cfd48 Binary files /dev/null and b/example/web/icons/Icon-512.png differ diff --git a/example/web/icons/Icon-maskable-192.png b/example/web/icons/Icon-maskable-192.png new file mode 100644 index 0000000..eb9b4d7 Binary files /dev/null and b/example/web/icons/Icon-maskable-192.png differ diff --git a/example/web/icons/Icon-maskable-512.png b/example/web/icons/Icon-maskable-512.png new file mode 100644 index 0000000..d69c566 Binary files /dev/null and b/example/web/icons/Icon-maskable-512.png differ diff --git a/example/web/index.html b/example/web/index.html new file mode 100644 index 0000000..b829dda --- /dev/null +++ b/example/web/index.html @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + example + + + + + + + diff --git a/example/web/manifest.json b/example/web/manifest.json new file mode 100644 index 0000000..096edf8 --- /dev/null +++ b/example/web/manifest.json @@ -0,0 +1,35 @@ +{ + "name": "example", + "short_name": "example", + "start_url": ".", + "display": "standalone", + "background_color": "#0175C2", + "theme_color": "#0175C2", + "description": "A new Flutter project.", + "orientation": "portrait-primary", + "prefer_related_applications": false, + "icons": [ + { + "src": "icons/Icon-192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "icons/Icon-512.png", + "sizes": "512x512", + "type": "image/png" + }, + { + "src": "icons/Icon-maskable-192.png", + "sizes": "192x192", + "type": "image/png", + "purpose": "maskable" + }, + { + "src": "icons/Icon-maskable-512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "maskable" + } + ] +} diff --git a/lib/kolors.dart b/lib/kolors.dart new file mode 100644 index 0000000..35cdb6f --- /dev/null +++ b/lib/kolors.dart @@ -0,0 +1,973 @@ +/// A simple library that contains the HTML named colors. +/// +/// You can access them all via the [Kolors] class, or via their grouped +/// classes, such as [KolorReds], [KolorPinks], [KolorOranges], +/// [KolorYellows], [KolorPurples], [KolorGreens], [KolorBlues], +/// [KolorBrowns], [KolorWhites], [KolorGrays]. +/// +/// Keep in mind that the [Color] has a Flutter dependency, so these named +/// colors can be only used from Flutter projects. +library html_colors; + +import 'dart:ui'; + +/// All the named HTML colors. +abstract class Kolors { + static const indianRed = Color(0xFFCD5C5C); + static const lightCoral = Color(0xFFF08080); + static const salmon = Color(0xFFFA8072); + static const darkSalmon = Color(0xFFE9967A); + static const lightSalmon = Color(0xFFFFA07A); + static const crimson = Color(0xFFDC143C); + static const red = Color(0xFFFF0000); + static const fireBrick = Color(0xFFB22222); + static const darkRed = Color(0xFF8B0000); + static const pink = Color(0xFFFFC0CB); + static const lightPink = Color(0xFFFFB6C1); + static const hotPink = Color(0xFFFF69B4); + static const deepPink = Color(0xFFFF1493); + static const mediumVioletRed = Color(0xFFC71585); + static const paleVioletRed = Color(0xFFDB7093); + static const coral = Color(0xFFFF7F50); + static const tomato = Color(0xFFFF6347); + static const orangeRed = Color(0xFFFF4500); + static const darkOrange = Color(0xFFFF8C00); + static const orange = Color(0xFFFFA500); + static const gold = Color(0xFFFFD700); + static const yellow = Color(0xFFFFFF00); + static const lightYellow = Color(0xFFFFFFE0); + static const lemonChiffon = Color(0xFFFFFACD); + static const lightGoldenrodYellow = Color(0xFFFAFAD2); + static const papayaWhip = Color(0xFFFFEFD5); + static const moccasin = Color(0xFFFFE4B5); + static const peachPuff = Color(0xFFFFDAB9); + static const paleGoldenrod = Color(0xFFEEE8AA); + static const khaki = Color(0xFFF0E68C); + static const darkKhaki = Color(0xFFBDB76B); + static const lavender = Color(0xFFE6E6FA); + static const thistle = Color(0xFFD8BFD8); + static const plum = Color(0xFFDDA0DD); + static const violet = Color(0xFFEE82EE); + static const orchid = Color(0xFFDA70D6); + static const fuchsia = Color(0xFFFF00FF); + static const magenta = Color(0xFFFF00FF); + static const mediumOrchid = Color(0xFFBA55D3); + static const mediumPurple = Color(0xFF9370DB); + static const rebeccaPurple = Color(0xFF663399); + static const blueViolet = Color(0xFF8A2BE2); + static const darkViolet = Color(0xFF9400D3); + static const darkOrchid = Color(0xFF9932CC); + static const darkMagenta = Color(0xFF8B008B); + static const purple = Color(0xFF800080); + static const indigo = Color(0xFF4B0082); + static const slateBlue = Color(0xFF6A5ACD); + static const darkSlateBlue = Color(0xFF483D8B); + static const mediumSlateBlue = Color(0xFF7B68EE); + static const greenYellow = Color(0xFFADFF2F); + static const chartreuse = Color(0xFF7FFF00); + static const lawnGreen = Color(0xFF7CFC00); + static const lime = Color(0xFF00FF00); + static const limeGreen = Color(0xFF32CD32); + static const paleGreen = Color(0xFF98FB98); + static const lightGreen = Color(0xFF90EE90); + static const mediumSpringGreen = Color(0xFF00FA9A); + static const springGreen = Color(0xFF00FF7F); + static const mediumSeaGreen = Color(0xFF3CB371); + static const seaGreen = Color(0xFF2E8B57); + static const forestGreen = Color(0xFF228B22); + static const green = Color(0xFF008000); + static const darkGreen = Color(0xFF006400); + static const yellowGreen = Color(0xFF9ACD32); + static const oliveDrab = Color(0xFF6B8E23); + static const olive = Color(0xFF808000); + static const darkOliveGreen = Color(0xFF556B2F); + static const mediumAquamarine = Color(0xFF66CDAA); + static const darkSeaGreen = Color(0xFF8FBC8B); + static const lightSeaGreen = Color(0xFF20B2AA); + static const darkCyan = Color(0xFF008B8B); + static const teal = Color(0xFF008080); + static const aqua = Color(0xFF00FFFF); + static const cyan = Color(0xFF00FFFF); + static const lightCyan = Color(0xFFE0FFFF); + static const paleTurquoise = Color(0xFFAFEEEE); + static const aquamarine = Color(0xFF7FFFD4); + static const turquoise = Color(0xFF40E0D0); + static const mediumTurquoise = Color(0xFF48D1CC); + static const darkTurquoise = Color(0xFF00CED1); + static const cadetBlue = Color(0xFF5F9EA0); + static const steelBlue = Color(0xFF4682B4); + static const lightSteelBlue = Color(0xFFB0C4DE); + static const powderBlue = Color(0xFFB0E0E6); + static const lightBlue = Color(0xFFADD8E6); + static const skyBlue = Color(0xFF87CEEB); + static const lightSkyBlue = Color(0xFF87CEFA); + static const deepSkyBlue = Color(0xFF00BFFF); + static const dodgerBlue = Color(0xFF1E90FF); + static const cornflowerBlue = Color(0xFF6495ED); + static const royalBlue = Color(0xFF4169E1); + static const blue = Color(0xFF0000FF); + static const mediumBlue = Color(0xFF0000CD); + static const darkBlue = Color(0xFF00008B); + static const navy = Color(0xFF000080); + static const midnightBlue = Color(0xFF191970); + static const cornsilk = Color(0xFFFFF8DC); + static const blanchedAlmond = Color(0xFFFFEBCD); + static const bisque = Color(0xFFFFE4C4); + static const navajoWhite = Color(0xFFFFDEAD); + static const wheat = Color(0xFFF5DEB3); + static const burlyWood = Color(0xFFDEB887); + static const tan = Color(0xFFD2B48C); + static const rosyBrown = Color(0xFFBC8F8F); + static const sandyBrown = Color(0xFFF4A460); + static const goldenrod = Color(0xFFDAA520); + static const darkGoldenrod = Color(0xFFB8860B); + static const peru = Color(0xFFCD853F); + static const chocolate = Color(0xFFD2691E); + static const saddleBrown = Color(0xFF8B4513); + static const sienna = Color(0xFFA0522D); + static const brown = Color(0xFFA52A2A); + static const maroon = Color(0xFF800000); + static const white = Color(0xFFFFFFFF); + static const snow = Color(0xFFFFFAFA); + static const honeyDew = Color(0xFFF0FFF0); + static const mintCream = Color(0xFFF5FFFA); + static const azure = Color(0xFFF0FFFF); + static const aliceBlue = Color(0xFFF0F8FF); + static const ghostWhite = Color(0xFFF8F8FF); + static const whiteSmoke = Color(0xFFF5F5F5); + static const seaShell = Color(0xFFFFF5EE); + static const beige = Color(0xFFF5F5DC); + static const oldLace = Color(0xFFFDF5E6); + static const floralWhite = Color(0xFFFFFAF0); + static const ivory = Color(0xFFFFFFF0); + static const antiqueWhite = Color(0xFFFAEBD7); + static const linen = Color(0xFFFAF0E6); + static const lavenderBlush = Color(0xFFFFF0F5); + static const mistyRose = Color(0xFFFFE4E1); + static const gainsboro = Color(0xFFDCDCDC); + static const lightGray = Color(0xFFD3D3D3); + static const silver = Color(0xFFC0C0C0); + static const darkGray = Color(0xFFA9A9A9); + static const gray = Color(0xFF808080); + static const dimGray = Color(0xFF696969); + static const lightSlateGray = Color(0xFF778899); + static const slateGray = Color(0xFF708090); + static const darkSlateGray = Color(0xFF2F4F4F); + static const black = Color(0xFF000000); + static const values = [ + indianRed, + lightCoral, + salmon, + darkSalmon, + lightSalmon, + crimson, + red, + fireBrick, + darkRed, + pink, + lightPink, + hotPink, + deepPink, + mediumVioletRed, + paleVioletRed, + coral, + tomato, + orangeRed, + darkOrange, + orange, + gold, + yellow, + lightYellow, + lemonChiffon, + lightGoldenrodYellow, + papayaWhip, + moccasin, + peachPuff, + paleGoldenrod, + khaki, + darkKhaki, + lavender, + thistle, + plum, + violet, + orchid, + fuchsia, + magenta, + mediumOrchid, + mediumPurple, + rebeccaPurple, + blueViolet, + darkViolet, + darkOrchid, + darkMagenta, + purple, + indigo, + slateBlue, + darkSlateBlue, + mediumSlateBlue, + greenYellow, + chartreuse, + lawnGreen, + lime, + limeGreen, + paleGreen, + lightGreen, + mediumSpringGreen, + springGreen, + mediumSeaGreen, + seaGreen, + forestGreen, + green, + darkGreen, + yellowGreen, + oliveDrab, + olive, + darkOliveGreen, + mediumAquamarine, + darkSeaGreen, + lightSeaGreen, + darkCyan, + teal, + aqua, + cyan, + lightCyan, + paleTurquoise, + aquamarine, + turquoise, + mediumTurquoise, + darkTurquoise, + cadetBlue, + steelBlue, + lightSteelBlue, + powderBlue, + lightBlue, + skyBlue, + lightSkyBlue, + deepSkyBlue, + dodgerBlue, + cornflowerBlue, + royalBlue, + blue, + mediumBlue, + darkBlue, + navy, + midnightBlue, + cornsilk, + blanchedAlmond, + bisque, + navajoWhite, + wheat, + burlyWood, + tan, + rosyBrown, + sandyBrown, + goldenrod, + darkGoldenrod, + peru, + chocolate, + saddleBrown, + sienna, + brown, + maroon, + white, + snow, + honeyDew, + mintCream, + azure, + aliceBlue, + ghostWhite, + whiteSmoke, + seaShell, + beige, + oldLace, + floralWhite, + ivory, + antiqueWhite, + linen, + lavenderBlush, + mistyRose, + gainsboro, + lightGray, + silver, + darkGray, + gray, + dimGray, + lightSlateGray, + slateGray, + darkSlateGray, + black, + ]; + + static Map asMap() => { + 'indianRed': indianRed, + 'lightCoral': lightCoral, + 'salmon': salmon, + 'darkSalmon': darkSalmon, + 'lightSalmon': lightSalmon, + 'crimson': crimson, + 'red': red, + 'fireBrick': fireBrick, + 'darkRed': darkRed, + 'pink': pink, + 'lightPink': lightPink, + 'hotPink': hotPink, + 'deepPink': deepPink, + 'mediumVioletRed': mediumVioletRed, + 'paleVioletRed': paleVioletRed, + 'coral': coral, + 'tomato': tomato, + 'orangeRed': orangeRed, + 'darkOrange': darkOrange, + 'orange': orange, + 'gold': gold, + 'yellow': yellow, + 'lightYellow': lightYellow, + 'lemonChiffon': lemonChiffon, + 'lightGoldenrodYellow': lightGoldenrodYellow, + 'papayaWhip': papayaWhip, + 'moccasin': moccasin, + 'peachPuff': peachPuff, + 'paleGoldenrod': paleGoldenrod, + 'khaki': khaki, + 'darkKhaki': darkKhaki, + 'lavender': lavender, + 'thistle': thistle, + 'plum': plum, + 'violet': violet, + 'orchid': orchid, + 'fuchsia': fuchsia, + 'magenta': magenta, + 'mediumOrchid': mediumOrchid, + 'mediumPurple': mediumPurple, + 'rebeccaPurple': rebeccaPurple, + 'blueViolet': blueViolet, + 'darkViolet': darkViolet, + 'darkOrchid': darkOrchid, + 'darkMagenta': darkMagenta, + 'purple': purple, + 'indigo': indigo, + 'slateBlue': slateBlue, + 'darkSlateBlue': darkSlateBlue, + 'mediumSlateBlue': mediumSlateBlue, + 'greenYellow': greenYellow, + 'chartreuse': chartreuse, + 'lawnGreen': lawnGreen, + 'lime': lime, + 'limeGreen': limeGreen, + 'paleGreen': paleGreen, + 'lightGreen': lightGreen, + 'mediumSpringGreen': mediumSpringGreen, + 'springGreen': springGreen, + 'mediumSeaGreen': mediumSeaGreen, + 'seaGreen': seaGreen, + 'forestGreen': forestGreen, + 'green': green, + 'darkGreen': darkGreen, + 'yellowGreen': yellowGreen, + 'oliveDrab': oliveDrab, + 'olive': olive, + 'darkOliveGreen': darkOliveGreen, + 'mediumAquamarine': mediumAquamarine, + 'darkSeaGreen': darkSeaGreen, + 'lightSeaGreen': lightSeaGreen, + 'darkCyan': darkCyan, + 'teal': teal, + 'aqua': aqua, + 'cyan': cyan, + 'lightCyan': lightCyan, + 'paleTurquoise': paleTurquoise, + 'aquamarine': aquamarine, + 'turquoise': turquoise, + 'mediumTurquoise': mediumTurquoise, + 'darkTurquoise': darkTurquoise, + 'cadetBlue': cadetBlue, + 'steelBlue': steelBlue, + 'lightSteelBlue': lightSteelBlue, + 'powderBlue': powderBlue, + 'lightBlue': lightBlue, + 'skyBlue': skyBlue, + 'lightSkyBlue': lightSkyBlue, + 'deepSkyBlue': deepSkyBlue, + 'dodgerBlue': dodgerBlue, + 'cornflowerBlue': cornflowerBlue, + 'royalBlue': royalBlue, + 'blue': blue, + 'mediumBlue': mediumBlue, + 'darkBlue': darkBlue, + 'navy': navy, + 'midnightBlue': midnightBlue, + 'cornsilk': cornsilk, + 'blanchedAlmond': blanchedAlmond, + 'bisque': bisque, + 'navajoWhite': navajoWhite, + 'wheat': wheat, + 'burlyWood': burlyWood, + 'tan': tan, + 'rosyBrown': rosyBrown, + 'sandyBrown': sandyBrown, + 'goldenrod': goldenrod, + 'darkGoldenrod': darkGoldenrod, + 'peru': peru, + 'chocolate': chocolate, + 'saddleBrown': saddleBrown, + 'sienna': sienna, + 'brown': brown, + 'maroon': maroon, + 'white': white, + 'snow': snow, + 'honeyDew': honeyDew, + 'mintCream': mintCream, + 'azure': azure, + 'aliceBlue': aliceBlue, + 'ghostWhite': ghostWhite, + 'whiteSmoke': whiteSmoke, + 'seaShell': seaShell, + 'beige': beige, + 'oldLace': oldLace, + 'floralWhite': floralWhite, + 'ivory': ivory, + 'antiqueWhite': antiqueWhite, + 'linen': linen, + 'lavenderBlush': lavenderBlush, + 'mistyRose': mistyRose, + 'gainsboro': gainsboro, + 'lightGray': lightGray, + 'silver': silver, + 'darkGray': darkGray, + 'gray': gray, + 'dimGray': dimGray, + 'lightSlateGray': lightSlateGray, + 'slateGray': slateGray, + 'darkSlateGray': darkSlateGray, + 'black': black, + }; +} + +/// Grouped colors for the different shades of Red from the supported HTML +/// colors. +abstract class KolorReds { + static const indianRed = Color(0xFFCD5C5C); + static const lightCoral = Color(0xFFF08080); + static const salmon = Color(0xFFFA8072); + static const darkSalmon = Color(0xFFE9967A); + static const lightSalmon = Color(0xFFFFA07A); + static const crimson = Color(0xFFDC143C); + static const red = Color(0xFFFF0000); + static const fireBrick = Color(0xFFB22222); + static const darkRed = Color(0xFF8B0000); + static const values = [ + indianRed, + lightCoral, + salmon, + darkSalmon, + lightSalmon, + crimson, + red, + fireBrick, + darkRed, + ]; + + static Map asMap() => { + 'indianRed': indianRed, + 'lightCoral': lightCoral, + 'salmon': salmon, + 'darkSalmon': darkSalmon, + 'lightSalmon': lightSalmon, + 'crimson': crimson, + 'red': red, + 'fireBrick': fireBrick, + 'darkRed': darkRed, + }; +} + +/// Grouped colors for the different shades of Pink from the supported HTML +/// colors. +abstract class KolorPinks { + static const pink = Color(0xFFFFC0CB); + static const lightPink = Color(0xFFFFB6C1); + static const hotPink = Color(0xFFFF69B4); + static const deepPink = Color(0xFFFF1493); + static const mediumVioletRed = Color(0xFFC71585); + static const paleVioletRed = Color(0xFFDB7093); + static const values = [ + pink, + lightPink, + hotPink, + deepPink, + mediumVioletRed, + paleVioletRed, + ]; + + static Map asMap() => { + 'pink': pink, + 'lightPink': lightPink, + 'hotPink': hotPink, + 'deepPink': deepPink, + 'mediumVioletRed': mediumVioletRed, + 'paleVioletRed': paleVioletRed, + }; +} + +/// Grouped colors for the different shades of Orange from the supported HTML +/// colors. +abstract class KolorOranges { + static const lightSalmon = Color(0xFFFFA07A); + static const coral = Color(0xFFFF7F50); + static const tomato = Color(0xFFFF6347); + static const orangeRed = Color(0xFFFF4500); + static const darkOrange = Color(0xFFFF8C00); + static const orange = Color(0xFFFFA500); + static const values = [ + lightSalmon, + coral, + tomato, + orangeRed, + darkOrange, + orange, + ]; + + static Map asMap() => { + 'lightSalmon': lightSalmon, + 'coral': coral, + 'tomato': tomato, + 'orangeRed': orangeRed, + 'darkOrange': darkOrange, + 'orange': orange, + }; +} + +/// Grouped colors for the different shades of Yellow from the supported HTML +/// colors. +abstract class KolorYellows { + static const gold = Color(0xFFFFD700); + static const yellow = Color(0xFFFFFF00); + static const lightYellow = Color(0xFFFFFFE0); + static const lemonChiffon = Color(0xFFFFFACD); + static const lightGoldenrodYellow = Color(0xFFFAFAD2); + static const papayaWhip = Color(0xFFFFEFD5); + static const moccasin = Color(0xFFFFE4B5); + static const peachPuff = Color(0xFFFFDAB9); + static const paleGoldenrod = Color(0xFFEEE8AA); + static const khaki = Color(0xFFF0E68C); + static const darkKhaki = Color(0xFFBDB76B); + static const values = [ + gold, + yellow, + lightYellow, + lemonChiffon, + lightGoldenrodYellow, + papayaWhip, + moccasin, + peachPuff, + paleGoldenrod, + khaki, + darkKhaki, + ]; + + static Map asMap() => { + 'gold': gold, + 'yellow': yellow, + 'lightYellow': lightYellow, + 'lemonChiffon': lemonChiffon, + 'lightGoldenrodYellow': lightGoldenrodYellow, + 'papayaWhip': papayaWhip, + 'moccasin': moccasin, + 'peachPuff': peachPuff, + 'paleGoldenrod': paleGoldenrod, + 'khaki': khaki, + 'darkKhaki': darkKhaki, + }; +} + +/// Grouped colors for the different shades of Purple from the supported HTML +/// colors. +abstract class KolorPurples { + static const lavender = Color(0xFFE6E6FA); + static const thistle = Color(0xFFD8BFD8); + static const plum = Color(0xFFDDA0DD); + static const violet = Color(0xFFEE82EE); + static const orchid = Color(0xFFDA70D6); + static const fuchsia = Color(0xFFFF00FF); + static const magenta = Color(0xFFFF00FF); + static const mediumOrchid = Color(0xFFBA55D3); + static const mediumPurple = Color(0xFF9370DB); + static const rebeccaPurple = Color(0xFF663399); + static const blueViolet = Color(0xFF8A2BE2); + static const darkViolet = Color(0xFF9400D3); + static const darkOrchid = Color(0xFF9932CC); + static const darkMagenta = Color(0xFF8B008B); + static const purple = Color(0xFF800080); + static const indigo = Color(0xFF4B0082); + static const slateBlue = Color(0xFF6A5ACD); + static const darkSlateBlue = Color(0xFF483D8B); + static const mediumSlateBlue = Color(0xFF7B68EE); + static const values = [ + lavender, + thistle, + plum, + violet, + orchid, + fuchsia, + magenta, + mediumOrchid, + mediumPurple, + rebeccaPurple, + blueViolet, + darkViolet, + darkOrchid, + darkMagenta, + purple, + indigo, + slateBlue, + darkSlateBlue, + mediumSlateBlue, + ]; + + static Map asMap() => { + 'lavender': lavender, + 'thistle': thistle, + 'plum': plum, + 'violet': violet, + 'orchid': orchid, + 'fuchsia': fuchsia, + 'magenta': magenta, + 'mediumOrchid': mediumOrchid, + 'mediumPurple': mediumPurple, + 'rebeccaPurple': rebeccaPurple, + 'blueViolet': blueViolet, + 'darkViolet': darkViolet, + 'darkOrchid': darkOrchid, + 'darkMagenta': darkMagenta, + 'purple': purple, + 'indigo': indigo, + 'slateBlue': slateBlue, + 'darkSlateBlue': darkSlateBlue, + 'mediumSlateBlue': mediumSlateBlue, + }; +} + +/// Grouped colors for the different shades of Green from the supported HTML +/// colors. +abstract class KolorGreens { + static const greenYellow = Color(0xFFADFF2F); + static const chartreuse = Color(0xFF7FFF00); + static const lawnGreen = Color(0xFF7CFC00); + static const lime = Color(0xFF00FF00); + static const limeGreen = Color(0xFF32CD32); + static const paleGreen = Color(0xFF98FB98); + static const lightGreen = Color(0xFF90EE90); + static const mediumSpringGreen = Color(0xFF00FA9A); + static const springGreen = Color(0xFF00FF7F); + static const mediumSeaGreen = Color(0xFF3CB371); + static const seaGreen = Color(0xFF2E8B57); + static const forestGreen = Color(0xFF228B22); + static const green = Color(0xFF008000); + static const darkGreen = Color(0xFF006400); + static const yellowGreen = Color(0xFF9ACD32); + static const oliveDrab = Color(0xFF6B8E23); + static const olive = Color(0xFF808000); + static const darkOliveGreen = Color(0xFF556B2F); + static const mediumAquamarine = Color(0xFF66CDAA); + static const darkSeaGreen = Color(0xFF8FBC8B); + static const lightSeaGreen = Color(0xFF20B2AA); + static const darkCyan = Color(0xFF008B8B); + static const teal = Color(0xFF008080); + static const values = [ + greenYellow, + chartreuse, + lawnGreen, + lime, + limeGreen, + paleGreen, + lightGreen, + mediumSpringGreen, + springGreen, + mediumSeaGreen, + seaGreen, + forestGreen, + green, + darkGreen, + yellowGreen, + oliveDrab, + olive, + darkOliveGreen, + mediumAquamarine, + darkSeaGreen, + lightSeaGreen, + darkCyan, + teal, + ]; + + static Map asMap() => { + 'greenYellow': greenYellow, + 'chartreuse': chartreuse, + 'lawnGreen': lawnGreen, + 'lime': lime, + 'limeGreen': limeGreen, + 'paleGreen': paleGreen, + 'lightGreen': lightGreen, + 'mediumSpringGreen': mediumSpringGreen, + 'springGreen': springGreen, + 'mediumSeaGreen': mediumSeaGreen, + 'seaGreen': seaGreen, + 'forestGreen': forestGreen, + 'green': green, + 'darkGreen': darkGreen, + 'yellowGreen': yellowGreen, + 'oliveDrab': oliveDrab, + 'olive': olive, + 'darkOliveGreen': darkOliveGreen, + 'mediumAquamarine': mediumAquamarine, + 'darkSeaGreen': darkSeaGreen, + 'lightSeaGreen': lightSeaGreen, + 'darkCyan': darkCyan, + 'teal': teal, + }; +} + +/// Grouped colors for the different shades of Blue from the supported HTML +/// colors. +abstract class KolorBlues { + static const aqua = Color(0xFF00FFFF); + static const cyan = Color(0xFF00FFFF); + static const lightCyan = Color(0xFFE0FFFF); + static const paleTurquoise = Color(0xFFAFEEEE); + static const aquamarine = Color(0xFF7FFFD4); + static const turquoise = Color(0xFF40E0D0); + static const mediumTurquoise = Color(0xFF48D1CC); + static const darkTurquoise = Color(0xFF00CED1); + static const cadetBlue = Color(0xFF5F9EA0); + static const steelBlue = Color(0xFF4682B4); + static const lightSteelBlue = Color(0xFFB0C4DE); + static const powderBlue = Color(0xFFB0E0E6); + static const lightBlue = Color(0xFFADD8E6); + static const skyBlue = Color(0xFF87CEEB); + static const lightSkyBlue = Color(0xFF87CEFA); + static const deepSkyBlue = Color(0xFF00BFFF); + static const dodgerBlue = Color(0xFF1E90FF); + static const cornflowerBlue = Color(0xFF6495ED); + static const mediumSlateBlue = Color(0xFF7B68EE); + static const royalBlue = Color(0xFF4169E1); + static const blue = Color(0xFF0000FF); + static const mediumBlue = Color(0xFF0000CD); + static const darkBlue = Color(0xFF00008B); + static const navy = Color(0xFF000080); + static const midnightBlue = Color(0xFF191970); + static const values = [ + aqua, + cyan, + lightCyan, + paleTurquoise, + aquamarine, + turquoise, + mediumTurquoise, + darkTurquoise, + cadetBlue, + steelBlue, + lightSteelBlue, + powderBlue, + lightBlue, + skyBlue, + lightSkyBlue, + deepSkyBlue, + dodgerBlue, + cornflowerBlue, + mediumSlateBlue, + royalBlue, + blue, + mediumBlue, + darkBlue, + navy, + midnightBlue, + ]; + + static Map asMap() => { + 'aqua': aqua, + 'cyan': cyan, + 'lightCyan': lightCyan, + 'paleTurquoise': paleTurquoise, + 'aquamarine': aquamarine, + 'turquoise': turquoise, + 'mediumTurquoise': mediumTurquoise, + 'darkTurquoise': darkTurquoise, + 'cadetBlue': cadetBlue, + 'steelBlue': steelBlue, + 'lightSteelBlue': lightSteelBlue, + 'powderBlue': powderBlue, + 'lightBlue': lightBlue, + 'skyBlue': skyBlue, + 'lightSkyBlue': lightSkyBlue, + 'deepSkyBlue': deepSkyBlue, + 'dodgerBlue': dodgerBlue, + 'cornflowerBlue': cornflowerBlue, + 'mediumSlateBlue': mediumSlateBlue, + 'royalBlue': royalBlue, + 'blue': blue, + 'mediumBlue': mediumBlue, + 'darkBlue': darkBlue, + 'navy': navy, + 'midnightBlue': midnightBlue, + }; +} + +/// Grouped colors for the different shades of Brown from the supported HTML +/// colors. +abstract class KolorBrowns { + static const cornsilk = Color(0xFFFFF8DC); + static const blanchedAlmond = Color(0xFFFFEBCD); + static const bisque = Color(0xFFFFE4C4); + static const navajoWhite = Color(0xFFFFDEAD); + static const wheat = Color(0xFFF5DEB3); + static const burlyWood = Color(0xFFDEB887); + static const tan = Color(0xFFD2B48C); + static const rosyBrown = Color(0xFFBC8F8F); + static const sandyBrown = Color(0xFFF4A460); + static const goldenrod = Color(0xFFDAA520); + static const darkGoldenrod = Color(0xFFB8860B); + static const peru = Color(0xFFCD853F); + static const chocolate = Color(0xFFD2691E); + static const saddleBrown = Color(0xFF8B4513); + static const sienna = Color(0xFFA0522D); + static const brown = Color(0xFFA52A2A); + static const maroon = Color(0xFF800000); + static const values = [ + cornsilk, + blanchedAlmond, + bisque, + navajoWhite, + wheat, + burlyWood, + tan, + rosyBrown, + sandyBrown, + goldenrod, + darkGoldenrod, + peru, + chocolate, + saddleBrown, + sienna, + brown, + maroon, + ]; + + static Map asMap() => { + 'cornsilk': cornsilk, + 'blanchedAlmond': blanchedAlmond, + 'bisque': bisque, + 'navajoWhite': navajoWhite, + 'wheat': wheat, + 'burlyWood': burlyWood, + 'tan': tan, + 'rosyBrown': rosyBrown, + 'sandyBrown': sandyBrown, + 'goldenrod': goldenrod, + 'darkGoldenrod': darkGoldenrod, + 'peru': peru, + 'chocolate': chocolate, + 'saddleBrown': saddleBrown, + 'sienna': sienna, + 'brown': brown, + 'maroon': maroon, + }; +} + +/// Grouped colors for the different shades of White from the supported HTML +/// colors. +abstract class KolorWhites { + static const white = Color(0xFFFFFFFF); + static const snow = Color(0xFFFFFAFA); + static const honeyDew = Color(0xFFF0FFF0); + static const mintCream = Color(0xFFF5FFFA); + static const azure = Color(0xFFF0FFFF); + static const aliceBlue = Color(0xFFF0F8FF); + static const ghostWhite = Color(0xFFF8F8FF); + static const whiteSmoke = Color(0xFFF5F5F5); + static const seaShell = Color(0xFFFFF5EE); + static const beige = Color(0xFFF5F5DC); + static const oldLace = Color(0xFFFDF5E6); + static const floralWhite = Color(0xFFFFFAF0); + static const ivory = Color(0xFFFFFFF0); + static const antiqueWhite = Color(0xFFFAEBD7); + static const linen = Color(0xFFFAF0E6); + static const lavenderBlush = Color(0xFFFFF0F5); + static const mistyRose = Color(0xFFFFE4E1); + static const values = [ + white, + snow, + honeyDew, + mintCream, + azure, + aliceBlue, + ghostWhite, + whiteSmoke, + seaShell, + beige, + oldLace, + floralWhite, + ivory, + antiqueWhite, + linen, + lavenderBlush, + mistyRose, + ]; + + static Map asMap() => { + 'white': white, + 'snow': snow, + 'honeyDew': honeyDew, + 'mintCream': mintCream, + 'azure': azure, + 'aliceBlue': aliceBlue, + 'ghostWhite': ghostWhite, + 'whiteSmoke': whiteSmoke, + 'seaShell': seaShell, + 'beige': beige, + 'oldLace': oldLace, + 'floralWhite': floralWhite, + 'ivory': ivory, + 'antiqueWhite': antiqueWhite, + 'linen': linen, + 'lavenderBlush': lavenderBlush, + 'mistyRose': mistyRose, + }; +} + +/// Grouped colors for the different shades of Gray from the supported HTML +/// colors. +abstract class KolorGrays { + static const gainsboro = Color(0xFFDCDCDC); + static const lightGray = Color(0xFFD3D3D3); + static const silver = Color(0xFFC0C0C0); + static const darkGray = Color(0xFFA9A9A9); + static const gray = Color(0xFF808080); + static const dimGray = Color(0xFF696969); + static const lightSlateGray = Color(0xFF778899); + static const slateGray = Color(0xFF708090); + static const darkSlateGray = Color(0xFF2F4F4F); + static const black = Color(0xFF000000); + static const values = [ + gainsboro, + lightGray, + silver, + darkGray, + gray, + dimGray, + lightSlateGray, + slateGray, + darkSlateGray, + black, + ]; + + static Map asMap() => { + 'gainsboro': gainsboro, + 'lightGray': lightGray, + 'silver': silver, + 'darkGray': darkGray, + 'gray': gray, + 'dimGray': dimGray, + 'lightSlateGray': lightSlateGray, + 'slateGray': slateGray, + 'darkSlateGray': darkSlateGray, + 'black': black, + }; +} diff --git a/pubspec.lock b/pubspec.lock new file mode 100644 index 0000000..816c48a --- /dev/null +++ b/pubspec.lock @@ -0,0 +1,161 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + async: + dependency: transitive + description: + name: async + url: "https://pub.dartlang.org" + source: hosted + version: "2.8.1" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + characters: + dependency: transitive + description: + name: characters + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + charcode: + dependency: transitive + description: + name: charcode + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.1" + clock: + dependency: transitive + description: + name: clock + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + collection: + dependency: transitive + description: + name: collection + url: "https://pub.dartlang.org" + source: hosted + version: "1.15.0" + fake_async: + dependency: transitive + description: + name: fake_async + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.4" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + lints: + dependency: transitive + description: + name: lints + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + matcher: + dependency: transitive + description: + name: matcher + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.10" + meta: + dependency: transitive + description: + name: meta + url: "https://pub.dartlang.org" + source: hosted + version: "1.7.0" + path: + dependency: transitive + description: + name: path + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.0" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_span: + dependency: transitive + description: + name: source_span + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.1" + stack_trace: + dependency: transitive + description: + name: stack_trace + url: "https://pub.dartlang.org" + source: hosted + version: "1.10.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + string_scanner: + dependency: transitive + description: + name: string_scanner + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + test_api: + dependency: transitive + description: + name: test_api + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.2" + typed_data: + dependency: transitive + description: + name: typed_data + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0" + vector_math: + dependency: transitive + description: + name: vector_math + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" +sdks: + dart: ">=2.12.0 <3.0.0" + flutter: ">=1.17.0" diff --git a/pubspec.yaml b/pubspec.yaml new file mode 100644 index 0000000..b1e7d14 --- /dev/null +++ b/pubspec.yaml @@ -0,0 +1,16 @@ +name: kolors +description: The named HTML colors that you can use in your Flutter apps. +version: 0.2.0+3 +homepage: https://www.github.com/dartsidedev/kolors +repository: https://www.github.com/dartsidedev/kolors +issue_tracker: https://www.github.com/dartsidedev/kolors/issues +environment: + sdk: ">=2.12.0 <3.0.0" + flutter: ">=1.17.0" +dependencies: + flutter: + sdk: flutter +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^1.0.0 \ No newline at end of file diff --git a/test/kolors_test.dart b/test/kolors_test.dart new file mode 100644 index 0000000..ff4e34d --- /dev/null +++ b/test/kolors_test.dart @@ -0,0 +1,144 @@ +import 'package:flutter_test/flutter_test.dart'; +import 'package:kolors/kolors.dart'; + +void main() { + group('values', () { + test('have the same values in grouped and ungrouped classes', () { + expect( + { + ...Kolors.values, + }, + { + ...KolorReds.values, + ...KolorPinks.values, + ...KolorOranges.values, + ...KolorYellows.values, + ...KolorPurples.values, + ...KolorGreens.values, + ...KolorBlues.values, + ...KolorBrowns.values, + ...KolorWhites.values, + ...KolorGrays.values, + }, + ); + }); + }); + + group('asMap', () { + test('have the same values in grouped and ungrouped classes', () { + expect( + { + ...Kolors.asMap(), + }, + { + ...KolorReds.asMap(), + ...KolorPinks.asMap(), + ...KolorOranges.asMap(), + ...KolorYellows.asMap(), + ...KolorPurples.asMap(), + ...KolorGreens.asMap(), + ...KolorBlues.asMap(), + ...KolorBrowns.asMap(), + ...KolorWhites.asMap(), + ...KolorGrays.asMap(), + }, + ); + }); + }); + + group('values-asMap', () { + test('all values are in the maps', () { + for (final v in Kolors.values) { + expect(Kolors.asMap().values, contains(v)); + } + + for (final v in KolorReds.values) { + expect(KolorReds.asMap().values, contains(v)); + } + + for (final v in KolorPinks.values) { + expect(KolorPinks.asMap().values, contains(v)); + } + + for (final v in KolorOranges.values) { + expect(KolorOranges.asMap().values, contains(v)); + } + + for (final v in KolorYellows.values) { + expect(KolorYellows.asMap().values, contains(v)); + } + + for (final v in KolorPurples.values) { + expect(KolorPurples.asMap().values, contains(v)); + } + + for (final v in KolorGreens.values) { + expect(KolorGreens.asMap().values, contains(v)); + } + + for (final v in KolorBlues.values) { + expect(KolorBlues.asMap().values, contains(v)); + } + + for (final v in KolorBrowns.values) { + expect(KolorBrowns.asMap().values, contains(v)); + } + + for (final v in KolorWhites.values) { + expect(KolorWhites.asMap().values, contains(v)); + } + + for (final v in KolorGrays.values) { + expect(KolorGrays.asMap().values, contains(v)); + } + }); + }); + + group('asMap-values', () { + test('all map values are in the values list', () { + for (final v in Kolors.asMap().values) { + expect(Kolors.values, contains(v)); + } + + for (final v in KolorReds.asMap().values) { + expect(KolorReds.values, contains(v)); + } + + for (final v in KolorPinks.asMap().values) { + expect(KolorPinks.values, contains(v)); + } + + for (final v in KolorOranges.asMap().values) { + expect(KolorOranges.values, contains(v)); + } + + for (final v in KolorYellows.asMap().values) { + expect(KolorYellows.values, contains(v)); + } + + for (final v in KolorPurples.asMap().values) { + expect(KolorPurples.values, contains(v)); + } + + for (final v in KolorGreens.asMap().values) { + expect(KolorGreens.values, contains(v)); + } + + for (final v in KolorBlues.asMap().values) { + expect(KolorBlues.values, contains(v)); + } + + for (final v in KolorBrowns.asMap().values) { + expect(KolorBrowns.values, contains(v)); + } + + for (final v in KolorWhites.asMap().values) { + expect(KolorWhites.values, contains(v)); + } + + for (final v in KolorGrays.asMap().values) { + expect(KolorGrays.values, contains(v)); + } + }); + }); +}