-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC: Oklab in react native #871
base: main
Are you sure you want to change the base?
RFC: Oklab in react native #871
Conversation
I've been doing some very recent work related to colors (and funnily enough just left a TODO for oklab). We are planning to replace existing ViewConfig processors with native parsing as part of some broader styling changes. facebook/react-native#48913 A general thing I wondered, is this something a designer would ever use? Perceptual color spaces are really neat because euclidean distance is the same thing as visual difference, which would have some good properties for interpolation I think (or special color math), but my assumption has been that it wouldn't often show up in real-world use-cases. I think some of the proposal is a bit inaccurate in the current state of P3 and color functions. As far as I'm aware, support for these has not landed. Instead we have a global API to treat sRGB colors against P3 primaries, which I really heavily dislike (instead of letting people use P3 primaries like on web, we added a global vibrant mode on iOS). We are somewhat close to being able to raise Android minSdkVersion to 26, which would simplify the implementation there as well (since RN can rely on color longs). I think that may happen this year. Another gotcha I noticed, is that a lot of this is happening at the Fabric layer. Right now, Android's props parsing path is effectively parallel to this, but there is work this half to correct that, and building these primitives in shared C++ is the right long term path. |
f9a8544
to
97e935c
Compare
When we met with @cipolleschi in Paris, I told him about how i feeel that color in RN were designed with RGB only in mind (see 1 and 2) and how I was feeling mixed between:
If you plan to improve the parsing and maybe the color datastructure yoursel, I'm really super happy.
I don't see designer using this directly in most cases. For me there is two exceptions:
But I agree, if we look at today ecosystem:
Evil Martians seems to be using oklab directly (see 3) and if you want, I can try to reach @ai to have return of experience of this at evilmartians.
Yeah, my understanding is the same:
I see oklab as a good way to support P3:
Not sure I understand this part, sorry. Would like to get more contexte on this to see the implication. |
Adding OkLab color space to React Native
View the rendered RFC