From 9f8d85f5435c4ec6f5ee5749b7f5ab9f21e91b1e Mon Sep 17 00:00:00 2001 From: Hans Kokx Date: Wed, 30 Oct 2024 10:13:30 +0100 Subject: [PATCH] v1.1.3 - Removed color extension Signed-off-by: Hans Kokx --- CHANGELOG.md | 4 ++++ README.md | 11 ----------- example/lib/main.dart | 7 ------- lib/arcane_helper_utils.dart | 1 - lib/src/extensions/color.dart | 14 -------------- pubspec.yaml | 3 +-- 6 files changed, 5 insertions(+), 35 deletions(-) delete mode 100644 lib/src/extensions/color.dart diff --git a/CHANGELOG.md b/CHANGELOG.md index 8acde17..74da327 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.1.3 + +- Removes `Color` extension due to an incompatibility with Flutter. Sorry, @rania-run! + ## 1.1.2 - Ensure new `Color` extensions are exported from the package. diff --git a/README.md b/README.md index c3fe70a..8461253 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,6 @@ providing utility functions and extensions that simplify common tasks. class, making it easier to format dates and calculate differences. - **String Extensions**: Enhances the `String` class by adding new methods for common transformations and checks, including JWT parsing. -- **Color Extensions**: Adds the ability to determine the luminance of a `Color` ## Getting Started @@ -331,16 +330,6 @@ objects: Additionally, the `CommonString` class provides a quick shortcut to common strings, such as punctuation marks that are otherwise cumbersome to find or type. -### Color Examples - -The following utilities have been added to enhance working with `Color` objects: - -- `luminance`: Computes the luminance of a given color. - - ```dart - final Color luminanceBasedColor = myColor.isDark ? Colors.white : Colors.black; - ``` - ## Contributing Contributions are welcome! Feel free to fork the repository and submit pull diff --git a/example/lib/main.dart b/example/lib/main.dart index 9c31e24..edfaa2b 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -1,7 +1,6 @@ // ignore_for_file: avoid_print import "package:arcane_helper_utils/arcane_helper_utils.dart"; -import "package:pure_dart_ui/pure_dart_ui.dart"; void main() { // DateTime @@ -36,10 +35,4 @@ void main() { const String lowercase = "hello"; final String capitalized = lowercase.capitalize; print(capitalized); // "Hello" - - // Color - const Color myColor = Color.fromARGB(255, 153, 97, 227); - final Color luminanceBasedcolor = - myColor.isDark ? const Color(0xff000000) : const Color(0xffffffff); - print(luminanceBasedcolor); // Color(0xff000000) } diff --git a/lib/arcane_helper_utils.dart b/lib/arcane_helper_utils.dart index 7ab4840..68f8ffe 100644 --- a/lib/arcane_helper_utils.dart +++ b/lib/arcane_helper_utils.dart @@ -1,6 +1,5 @@ library arcane_helper_utils; -export "package:arcane_helper_utils/src/extensions/color.dart"; export "package:arcane_helper_utils/src/extensions/date_time.dart"; export "package:arcane_helper_utils/src/extensions/string.dart"; export "package:arcane_helper_utils/src/extensions/string_jwt.dart"; diff --git a/lib/src/extensions/color.dart b/lib/src/extensions/color.dart deleted file mode 100644 index 6db45b0..0000000 --- a/lib/src/extensions/color.dart +++ /dev/null @@ -1,14 +0,0 @@ -import "package:pure_dart_ui/pure_dart_ui.dart"; - -/// A collection of extensions for the `Color` class. -extension ColorsExtensions on Color { - /// Determines if the color is considered dark. - /// - /// A color is considered dark if its luminance is less than 0.5. - bool get isDark { - final luminance = computeLuminance(); - // Luminance values range from 0 to 1, where 0 is black and 1 is white. - // A luminance value below 0.5 indicates a dark color. - return luminance < 0.5; - } -} diff --git a/pubspec.yaml b/pubspec.yaml index 3249ce7..dcfb42c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: arcane_helper_utils description: Provides a variety of helpful utilities and extensions for Flutter and Dart. -version: 1.1.2 +version: 1.1.3 repository: https://github.com/hanskokx/arcane_helper_utils issue_tracker: https://github.com/hanskokx/arcane_helper_utils/issues @@ -15,7 +15,6 @@ environment: dependencies: freezed_annotation: ^2.4.4 - pure_dart_ui: ^0.1.10 week_number: ^1.1.0 dev_dependencies: