From 94e6e7657f89790ee5a1a599ddf84553c3f90ae3 Mon Sep 17 00:00:00 2001 From: Felix Date: Mon, 26 Jul 2021 17:41:02 +0200 Subject: [PATCH 01/11] Set new URL in pubspec.yaml --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index eef5023..c22d0ca 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: tinycolor2 description: Flutter Color manipulation and conversion, ported from JS tinycolor2 version: 2.0.0 -homepage: https://github.com/TinyCommunity/tinycolor2 +homepage: https://tinycommunity.dev/ environment: sdk: ">=2.12.0-0 <3.0.0" From 028e17c6dfc0606ddee954d472eb03add1cc54d6 Mon Sep 17 00:00:00 2001 From: Felix Date: Mon, 26 Jul 2021 17:41:58 +0200 Subject: [PATCH 02/11] Set date in CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a4da721..850fce2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## [2.0.0] - TBD +## [2.0.0] - 2021-07-26 ### Added * `.toHex8()` at [PR #17](https://github.com/TinyCommunity/tinycolor2/pull/17) From c66074864e2cfb751c4079757e5dd0c0feb3a90b Mon Sep 17 00:00:00 2001 From: Felix Date: Mon, 26 Jul 2021 17:41:02 +0200 Subject: [PATCH 03/11] Revert "Set new URL in pubspec.yaml" This reverts commit 94e6e7657f89790ee5a1a599ddf84553c3f90ae3. --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index c22d0ca..eef5023 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: tinycolor2 description: Flutter Color manipulation and conversion, ported from JS tinycolor2 version: 2.0.0 -homepage: https://tinycommunity.dev/ +homepage: https://github.com/TinyCommunity/tinycolor2 environment: sdk: ">=2.12.0-0 <3.0.0" From 92ada58ea896bdb7c4ec7f574495317c769ce15b Mon Sep 17 00:00:00 2001 From: Felix Date: Tue, 27 Jul 2021 17:21:35 +0200 Subject: [PATCH 04/11] Change date in changelog to 07-27 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 850fce2..051a8f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## [2.0.0] - 2021-07-26 +## [2.0.0] - 2021-07-27 ### Added * `.toHex8()` at [PR #17](https://github.com/TinyCommunity/tinycolor2/pull/17) From 55f37c1dfd3d4e545d6fc10d85477cdc05105bc1 Mon Sep 17 00:00:00 2001 From: Felix Date: Tue, 27 Jul 2021 21:44:16 +0200 Subject: [PATCH 05/11] Format tinycolor.dart --- lib/src/tinycolor.dart | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/lib/src/tinycolor.dart b/lib/src/tinycolor.dart index 6ec590e..60b307e 100644 --- a/lib/src/tinycolor.dart +++ b/lib/src/tinycolor.dart @@ -79,19 +79,25 @@ class TinyColor { final color = Color.fromARGB( _color.alpha, math.max( - 0, math.min( - 255, _color.red - (255 * -(amount / 100)).round(), - ), + 0, + math.min( + 255, + _color.red - (255 * -(amount / 100)).round(), + ), ), math.max( - 0, math.min( - 255, _color.green - (255 * -(amount / 100)).round(), - ), + 0, + math.min( + 255, + _color.green - (255 * -(amount / 100)).round(), + ), ), math.max( - 0, math.min( - 255, _color.blue - (255 * -(amount / 100)).round(), - ), + 0, + math.min( + 255, + _color.blue - (255 * -(amount / 100)).round(), + ), ), ); return TinyColor(color); From ef046002411df64f3e9e78340d72fb7bcfbd69dd Mon Sep 17 00:00:00 2001 From: Felix Date: Tue, 27 Jul 2021 21:44:27 +0200 Subject: [PATCH 06/11] Format + lint fix tinycolor_test.dart --- test/tinycolor_test.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/tinycolor_test.dart b/test/tinycolor_test.dart index 093cebe..e1d11ed 100644 --- a/test/tinycolor_test.dart +++ b/test/tinycolor_test.dart @@ -7,7 +7,7 @@ void main() { test( "setAlpha updates alpha value of color", () { - TinyColor color = TinyColor(Color(0xFFFFFFFF)); + final TinyColor color = TinyColor(const Color(0xFFFFFFFF)); color.setAlpha(0x00); expect(color.color.alpha, 0x00); }, @@ -16,10 +16,10 @@ void main() { test( "setOpacity updates opacity value of color", () { - TinyColor color = TinyColor(Color(0xFFFFFFFF).withOpacity(1.0)); + final TinyColor color = TinyColor(const Color(0xFFFFFFFF).withOpacity(1.0)); color.setOpacity(0.5); - // underlying dart implementation converts the opacity value to an + // underlying dart implementation converts the opacity value to an // int, then back into a double. Thus some precision is loss. expect(color.color.opacity, moreOrLessEquals(0.5, epsilon: 1e-2)); }, From cb07ed0267f8f90097f10e804cda043298ea527d Mon Sep 17 00:00:00 2001 From: Felix Date: Tue, 27 Jul 2021 21:46:09 +0200 Subject: [PATCH 07/11] Re-format tinycolor_test.dart --- test/tinycolor_test.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/tinycolor_test.dart b/test/tinycolor_test.dart index e1d11ed..787345d 100644 --- a/test/tinycolor_test.dart +++ b/test/tinycolor_test.dart @@ -16,7 +16,8 @@ void main() { test( "setOpacity updates opacity value of color", () { - final TinyColor color = TinyColor(const Color(0xFFFFFFFF).withOpacity(1.0)); + final TinyColor color = + TinyColor(const Color(0xFFFFFFFF).withOpacity(1.0)); color.setOpacity(0.5); // underlying dart implementation converts the opacity value to an From 06abf7853a25568933bd12230b7e49d222771284 Mon Sep 17 00:00:00 2001 From: Felix Date: Wed, 28 Jul 2021 17:17:16 +0200 Subject: [PATCH 08/11] Changed changelog release date to 07-28 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 051a8f4..d9019e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## [2.0.0] - 2021-07-27 +## [2.0.0] - 2021-07-28 ### Added * `.toHex8()` at [PR #17](https://github.com/TinyCommunity/tinycolor2/pull/17) From 66678102f43bc6db360dae710dc2d0dca00f2f2c Mon Sep 17 00:00:00 2001 From: Felix Date: Wed, 28 Jul 2021 17:22:31 +0200 Subject: [PATCH 09/11] Renamed LICENSE.md back to LICENSE --- LICENSE.md => LICENSE | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename LICENSE.md => LICENSE (100%) diff --git a/LICENSE.md b/LICENSE similarity index 100% rename from LICENSE.md rename to LICENSE From f9ca612baeb9636e516c583409d597b2c92dc599 Mon Sep 17 00:00:00 2001 From: Felix Date: Wed, 28 Jul 2021 17:23:11 +0200 Subject: [PATCH 10/11] Removed <3.0.0 flutter upper bound --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index eef5023..31a4b27 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -5,7 +5,7 @@ homepage: https://github.com/TinyCommunity/tinycolor2 environment: sdk: ">=2.12.0-0 <3.0.0" - flutter: ">=1.12.0 <3.0.0" + flutter: ">=1.12.0" dependencies: flutter: From 95bf3bd00cb76c97bbe5f456ca88214b735a9281 Mon Sep 17 00:00:00 2001 From: Felix Date: Wed, 28 Jul 2021 17:25:09 +0200 Subject: [PATCH 11/11] Removed pre-release "-0" from dart SDK lower bound --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 31a4b27..86e46e5 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,7 +4,7 @@ version: 2.0.0 homepage: https://github.com/TinyCommunity/tinycolor2 environment: - sdk: ">=2.12.0-0 <3.0.0" + sdk: ">=2.12.0 <3.0.0" flutter: ">=1.12.0" dependencies: