- Added `Color().luminance` extension (thanks @rania-run)
- Fixed a bug in `String.splitByLength()`

Signed-off-by: Hans Kokx <hans.kokx@hackberry.se>
This commit is contained in:
Hans Kokx
2024-10-29 11:34:10 +01:00
parent adb4217c35
commit 15f831f1dd
6 changed files with 47 additions and 3 deletions
+11
View File
@@ -15,6 +15,7 @@ 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
@@ -330,6 +331,16 @@ 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