Repository navigation
Description
After #55092 we have wide gamut support in the iOS engine, and after #127852 we'll have wide gamut support on Android.
Users have asked for ways to represent those colors inside of the framework so they can do things like:
Container(color: Color.displayP3(0.0, 0.0, 1.0, 1.0))It's important that we don't change the meaning of old colors, that's why a normalized constructor for the Display P3 colorspace would be preferable.
I presume users would want to clip wide gamut colors to sRGB if their app is run on a device/platform without wide gamut support. It's unclear to me if that's acceptable to designers. If someone is making an iOS only app though they can pretty confidently known that wide gamut support will be supported.
This should have almost no effect on engine performance since the capability for wide gamut will already exist by virtue of having support for images.
We have to consider also the ramifications for Web and Desktop platforms. The absence of support for wide gamut colors in those platforms will become more apparent if the framework is updated to support them.
Activity
jtkeyva commentedon May 31, 2023
awesome, thanks for clarifying this here. from a designers perspective, i don't know what good wide gamut images are without wide gamut UI or wide gamut video. i feel this is essential for a consistent ui/ux that has all the polish, shine and vibrant interface that consumers want and need.
what about video? there is no mention of wide gamut color is/can be in video? do you need a separate issue for that?
the user experience is what matters most to the users. this "dull / flat" color and the touch response latency issues (and 2 finger scroll speed lol) are essentially the only thing that doesn't feel native. if you patch those up, flutter is essentially indistinguishable from native.
go team! go flutter! thanks for listening to the community and implementing what's important to us :)
Cheers!
Maistho commentedon Jun 1, 2023
I don't know about Desktop, but Web supports wide gamut colors for both images and UI. Theres a good article on the chrome developer blog regarding this: https://developer.chrome.com/articles/high-definition-css-color-guide/
Around 80% of people already use browsers that support wide gamut colors: https://caniuse.com/css-color-function
jabedamin commentedon Jun 2, 2023
This is great, thank you! This step really is crucial to completing the support for wide gamut colours. Absolutely agree with the points made by @jtkeyva.
I'm not sure how many variations to this there are but, when designing, I'd choose the Colour space to work with in the design software based on the target platform. Then input varying colour codes for different objects. If we had to specify the colour space for every object, wouldn't be scalable. If we could set the colour space at an app level however, then whatever RGB values we enter would get converted ideally based on what the device supports. So essentially, whatever colour space we set on the design project, we'd apply to the app. That way the output is consistent.
jabedamin commentedon Jun 16, 2023
gaaclarke commentedon Jun 16, 2023
jabedamin commentedon Jun 17, 2023
MaherSafadii commentedon Jun 22, 2024
this is a major issue in flutter which should be fixed asap imo.
gaaclarke commentedon Aug 1, 2024
I've written a design doc for this: https://docs.google.com/document/d/1JaJg34uB7bVssr3oyS-QLe2FlZHUIHcR6aG83JlKwak/edit
bernaferrari commentedon Aug 6, 2024
My feedback:
kColorSpace = .p3and then it applies automatically unless otherwise written. CSS allows a fallback option for non-p3. Not sure if we want that, but it is interesting you can have both.knopp commentedon Aug 6, 2024
Can't add comments to the design doc. I'm wondering if 320bits for Color instance is bit of an overkill. Android Color packs everything into 64bits even for wide gamut (16 bits per channel, 10bit alpha, 6 bit colorspace). This might be problematic when compiling to javascript, but I'm not certain if supporting wide gamut for web/js is even feasible.
23 remaining items
Adds wide gamut framework breakage notice. (#11082)
Update color assertions (#154752)
Update Color to do all calculations with floating point components (#…
Adds note about color equality after wide gamut. (#11132)
Update Color to do all calculations with floating point components (f…
Update Color to do all calculations with floating point components (f…
Update Color to do all calculations with floating point components (f…
Update Color to do all calculations with floating point components (f…
Reland: Update Color to do all calculations with floating point compo…
gaaclarke commentedon Sep 30, 2024
There's no further planned work here. All the related PR's have landed, rolled and stuck.
squirelboy360 commentedon Sep 30, 2024
I just saw this, how can we use this. Is it enabled by default?
gaaclarke commentedon Sep 30, 2024
It's available by default in the framework, see https://github.com/flutter/engine/blob/a49703b6383e54b48ebb710a92d81dffd0bd3d33/lib/ui/painting.dart#L118
It will however only be rendered as a wide gamut / high bitrate color on iOS. There is the design doc above that you can check out too ( http://flutter.dev/go/wide-gamut-framework ).
github-actions commentedon Oct 14, 2024
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.