Skip to content

Add Display P3 wide gamut colors profile to Flutter (a.k.a. enable 25% more colors in Flutter) #55092

Description

@tomasbaran

Use case

25% more colors

First off, my app is full of imagery. iPhones (since iPhone 7), iPads, Macs and Android devices have been using Display P3 wide gamut for some years now. It's kinda last century to give users the old sRGB colors, when their phones support the wider P3 gamut that provides 25% larger color space. Important especially for images.

Color discrepancy btw iOS and Android

Second, I'm not sure it's related to the same issue but there is a discrepancy between colors on Android and iOS when running from the same Flutter codebase. More here: #39113

Flutter shall achieve the same quality as the native code

Third, when writing a native iOS app, you can choose which Color Profile you want to write the app in (sRGB/P3). So, when choosing to write a Flutter app (instead of a native one), you are limited and won't achieve the same results. We want to achieve the same in Flutter as in native!

Proposal

Please, add an option to choose which color Profile we want to write Flutter apps, so they truly are beautiful as they are meant be. It is one of the Flutter pillars, right?

More info by Apple, Google

Activity

  1. tomasbaran commented on Apr 18, 2020

    @tomasbaran
    Author

    @brianosman I guess, you know more about this topic. Can you shed some light on it? Thanks, Brian.

  2. added
    engineflutter/engine related. See also e: labels.
    c: proposalA detailed proposal for a change to Flutter
    on Apr 20, 2020
  3. fredlee12345678 commented on May 13, 2020

    @fredlee12345678
    Contributor

    @tomasbaran @brianegan do you have plan on adding Display P3 to Flutter?

  4. tomasbaran commented on May 13, 2020

    @tomasbaran
    Author

    @fredlee12345678 I hope @brianegan will be able to tell us more about this topic or even better I hope he or someone else will be able to implement this feature.

    I just need that feature in my apps but since I'm just starting with app development—I'm not qualified for implementing it in Flutter.

  5. tomasbaran commented on May 13, 2020

    @tomasbaran
    Author

    But looking at Apple instructions (https://developer.apple.com/videos/play/wwdc2017/821/) it may not be that difficult to implement:

    Captura de pantalla 2020-05-13 a las 11 30 04

  6. brianegan commented on May 15, 2020

    @brianegan
    Contributor

    Hey all -- I seem to have been tagged on this one, but I think I'm the wrong person ^^

  7. fredlee12345678 commented on May 28, 2020

    @fredlee12345678
    Contributor

    It seems none follow this issue?

  8. added
    P3Issues that are less important to the Flutter project
    on Dec 10, 2020
  9. added
    platform-androidAndroid applications specifically
    platform-iosiOS applications specifically
    a: fidelityMatching the OEM platforms better
    P2Important issues not at the top of the work list
    and removed
    P3Issues that are less important to the Flutter project
    on Aug 5, 2021
  10. 46 remaining items

  11. textzenith commented on May 10, 2023

    @textzenith

    However, I did do some research above to convince the team that we aren't painting ourselves into the proverbial corner with respect to Android.

    I should hope so, I'm actually using Flutter because it's much better on Android than React Native (which is completely unusable). Other developers seem to love the other platforms because they focus on iOS, but as for me I see Flutter's usability on Android as a trump card. Don't drop the ball on Android!

  12. added a commit that references this issue on May 12, 2023
  13. fiercepark commented on May 15, 2023

    @fiercepark

    flutter/engine#39111 behind the FLTEnableWideGamut Info.plist value on iOS only is available in Flutter 3.8.0-12.0.pre

    This is now in the beta channel.

    21684140849_ pic copy
    We have a great p3 colour space in flutter 3.10, a great milestone, but Color(0xff${hex}) is currently displayed incorrectly.

  14. gaaclarke commented on May 15, 2023

    @gaaclarke
    Member

    @fiercepark can you file an issue if you've identified a bug, please.

  15. jabedamin commented on May 25, 2023

    @jabedamin

    @jmagman We've upgraded an app to Flutter 3.10.1. And enabled FLTEnableWideGamut in info.plist as recommended in the flutter announcement (also tried with FLTEnableImpeller flag although that should be default in this flutter version - still no luck). On running the app the colours don't appear any differently? Is there something else I need to do in order to enable the feature? Or a certain Flutter method that replaces Color.fromRGB0(0, 209, 169,1)?

  16. gaaclarke commented on May 25, 2023

    @gaaclarke
    Member

    @jabedamin wide gamut colors are only displayed if you have wide gamut images or are using gradients. Please file an issue with a screenshot if you expect wide gamut colors and aren't seeing it.

  17. jabedamin commented on May 25, 2023

    @jabedamin

    @gaaclarke I see, I was hoping flutter objects would also support wide gamut colours in addition to images. For example Button color or Container(color: Colors.blueAccent), is that not supported? If not, any plans to support in the future? It's these colours that are sometimes more visibly dull than images.

  18. gaaclarke commented on May 25, 2023

    @gaaclarke
    Member

    @jabedamin we're never going to change the existing code to mean something different. We might add new colors in the future, something like Container(color: Color.displayP3(0.0, 0.0, 1.0, 1.0)).

  19. jabedamin commented on May 25, 2023

    @jabedamin

    @gaaclarke yes that would help hugely. I suspect many others are interested in this too, in order for Flutter UIs to level up to native apps on Swift.

    This might be my lack of understanding on how the code behind the scenes renders colours in Flutter. I was thinking more in the sense of displaying colours based on available colour spaces on any given device. So when designing an app, if the designer uses for example RGB(0, 209, 169) on an object - this RGB code would not not change, but it would be displayed differently depending on the device and supported colour space.

  20. jtkeyva commented on May 28, 2023

    @jtkeyva

    @gaaclarke and @jabedamin yeah this almost feels like a "gotcha" moment that was too good to be true. of course i appreciate the p3 support for images, i fought for it! i assumed from the title "Add Display P3 wide gamut colors profile to Flutter (a.k.a. enable 25% more colors in Flutter)" it would be 25% more colors across the entire app ui. seems a shame to have vibrant images and still a flat dull UI if it's capable.

    the end user is the customer and the customer likes the bright shiny silky smooth end product. what can we do to push up the priority on this?
    thanks

  21. gaaclarke commented on May 30, 2023

    @gaaclarke
    Member

    Okay, here's what we are going to do. This issue is very broad and I believe that the majority of what it represents has now been fulfilled on main. Namely:

    1. iOS Display P3 support
    2. Display wide gamut images correctly
    3. Take advantage of higher bits/pixel for gradients

    All of that is on main and on by default now. So, I'm going to close this issue and open more specific issues that represent any remaining potential work that's been discussed here so people can discuss them / upvote them:

    1. Add support for Android -- [Impeller] Implement Wide Gamut colors for Vulkan #127852
    2. Add support for the Framework -- Implement wide gamut color support in the Framework #127855

    If there is anything else I missed, please file an issue (including if you have found a bug in wide gamut image support).

  22. jtkeyva commented on May 31, 2023

    @jtkeyva

    thank you!

    for those who aren't following this closely, is it ok to post this in reddit r/flutterdev to inform people? just as i thought it was a huge win, i don't think the community there knows that it's only for wide gamut images.

    is it ok to notify them ell them where to go to and discuss / upvote it if they find it important to them to include in the framework?

    i don't want to get dinged for "farming" upvotes like someone warned about

  23. github-actions commented on Jun 14, 2023

    @github-actions

    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 -v and a minimal reproduction of the issue.

  24. locked as resolved and limited conversation to collaborators on Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: fidelityMatching the OEM platforms betterc: proposalA detailed proposal for a change to Fluttercustomer: crowdAffects or could affect many people, though not necessarily a specific customer.engineflutter/engine related. See also e: labels.platform-androidAndroid applications specificallyplatform-iosiOS applications specifically

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions