Skip to content

Support Flutter 3.x wide gamut changes, Fix okLab<->RGB conversions (gamma correction math was swapped), Fixes #9, Fixes #6#12

Merged
james-alex merged 5 commits intojames-alex:masterfrom
timmaffett:flutter3
Mar 26, 2025
Merged

Support Flutter 3.x wide gamut changes, Fix okLab<->RGB conversions (gamma correction math was swapped), Fixes #9, Fixes #6#12
james-alex merged 5 commits intojames-alex:masterfrom
timmaffett:flutter3

Conversation

@timmaffett
Copy link
Contributor

Flutter 3.x added additional members to the ui.Color class (withValues() method and r, g, b, and a getters. This necessitated changes to change the existing withValues() method to withValuesList() and adding getters for r, g, b, and a . This also required renaming the existing aandbchromaticity getters forLabColorandOklabColortolab_aandlab_b`.

@timmaffett
Copy link
Contributor Author

These are breaking changes to I increased the semantic version to 2.0.0 for each package because of this.

Also pubspec.yaml files will need to be changed for publishing to reference corresponding packages instead of local directories (I can't publish the package so I could not fix this)

@timmaffett
Copy link
Contributor Author

Flutter Web example using PR and corresponding PR/updated gradients package:
https://timmaffett.github.io/gradients_package_example/

@timmaffett
Copy link
Contributor Author

I think you should add the web version to your own james-alex.github.io and add a link in the README.md file
(or feel free to link to the version at https://timmaffett.github.io/gradients_package_example/ for now.)

I have placed a buildWeb.bat file in the example directory that will build a web version that can be placed in a subdirectory called gradients_package_example or edit the batch file to call the directory anything you wish.

I think having the web example will help illustrate to users how simple it is to use your package and the nice benefits that it can provide in nicer gradients.

@timmaffett
Copy link
Contributor Author

I just became aware that this PR is mostly a duplicate of PR #10.
I have rename/changed all of my identical code from PR#10 to match.

Now the only differences between this PR and PR#10 are the some missing @override directives,
the addition of the factor constructor to flutter_color_model's ColorModel class that takes a ui.Color,
and using a semantic version nunber of 2.0.0 because these PR's are breaking changes (however minor).

@timmaffett timmaffett changed the title Updated to support Flutter 3.x which changed ui.Color to add additional members, Fixes #11 Updated to support Flutter 3.x wide gamut changes which changed ui.Color to add additional members, Fixes #9 Sep 7, 2024
@timmaffett timmaffett changed the title Updated to support Flutter 3.x wide gamut changes which changed ui.Color to add additional members, Fixes #9 Support Flutter 3.x wide gamut changes, Fix okLab<->RGB conversions (gamma correction math was swapped), Fixes #9, Fixes #6 Sep 8, 2024
@james-alex james-alex merged commit 84b2ed5 into james-alex:master Mar 26, 2025
@timmaffett
Copy link
Contributor Author

yay! Thanks James!

@rajveermalviya
Copy link

@james-alex It looks like there was a new release pushed with this fixed for color_models package but not for flutter_color_models package.
Can please push a new release for flutter_color_models too, Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments