You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently in our themes we define a hex value and it ends up being a much different shade than what was specified. This may have something to do with how the hex is interpreted.
@armartinez Yes, if you open CodeEdit/DefaultThemes/codeedit-xcode-dark.json, you will see the Xcode Dark theme. It looks like the colors are off. So we went to the theme in Xcode and sampled each color, but even them it was off.
I sampled colors from the following sources and this is what I got...
It should match the default theme in Xcode exactly. I am suspicious that when I take a screenshot, the colors are muted and I get an inaccurate sample. Maybe it doesn't capture in P3 color, or it doesn't paste into Figma (where I do the color sample) into P3 color.
@austincondiff Yeah I've been trying the Digital Color Picker but there can be differences between what is selected and what the monitor is outputting depending on the color profile. I'll try to just match the color from what it's being displayed in Xcode and CodeEdit.
@austincondiff I found the issue. Xcode uses by default the color profile Generic RGB which is an old profile from the NSColorSpace (https://developer.apple.com/documentation/appkit/nscolorspace/1412082-genericrgbcolorspace?language=objc) while SwiftUI defaults to sRGB. For us to change that we would need to refactor the whole Color extension which doesn't seem worth it. I can convert the Xcode themes to srgb easily and use those value in the CodeEdit themes, this is a sample on how that looks (Left is CodeEdit) :
1 - We are currently using the SwiftUI Color class to represent colors. This class accepts an enum RGBColorSpace which doesn't include the Generic RGB profile. In order to use that, we would have to replace the Color class with something like CGColor which accepts a CGColorSpace argument that includes GenericRGBLinear profile or find a way to extend the Color class to accept a new type of profile, which I don't know if it's even possible.
2 - Yes I mean the json file, and I would just switch the current hex value (sRGB) for it's corresponding GenericRGB hex value.
Activity
[-]✨ Use accurate colors in themes[/-][+]🐞 Interpreted theme colors are inaccurate[/+]armartinez commentedon Jan 15, 2024
@austincondiff I'm looking into this, do you have a concrete example where this problem is obvious ?
austincondiff commentedon Jan 15, 2024
@armartinez Yes, if you open CodeEdit/DefaultThemes/codeedit-xcode-dark.json, you will see the Xcode Dark theme. It looks like the colors are off. So we went to the theme in Xcode and sampled each color, but even them it was off.
I sampled colors from the following sources and this is what I got...
It should match the default theme in Xcode exactly. I am suspicious that when I take a screenshot, the colors are muted and I get an inaccurate sample. Maybe it doesn't capture in P3 color, or it doesn't paste into Figma (where I do the color sample) into P3 color.
armartinez commentedon Jan 15, 2024
@austincondiff Yeah I've been trying the Digital Color Picker but there can be differences between what is selected and what the monitor is outputting depending on the color profile. I'll try to just match the color from what it's being displayed in Xcode and CodeEdit.
armartinez commentedon Jan 16, 2024
@austincondiff I found the issue. Xcode uses by default the color profile
Generic RGBwhich is an old profile from the NSColorSpace (https://developer.apple.com/documentation/appkit/nscolorspace/1412082-genericrgbcolorspace?language=objc) while SwiftUI defaults to sRGB. For us to change that we would need to refactor the whole Color extension which doesn't seem worth it. I can convert the Xcode themes to srgb easily and use those value in the CodeEdit themes, this is a sample on how that looks (Left is CodeEdit) :austincondiff commentedon Jan 16, 2024
@armartinez could you clarify what you mean exactly by...
armartinez commentedon Jan 16, 2024
@austincondiff sure :
1 - We are currently using the SwiftUI Color class to represent colors. This class accepts an enum RGBColorSpace which doesn't include the Generic RGB profile. In order to use that, we would have to replace the Color class with something like CGColor which accepts a CGColorSpace argument that includes GenericRGBLinear profile or find a way to extend the Color class to accept a new type of profile, which I don't know if it's even possible.
2 - Yes I mean the json file, and I would just switch the current hex value (sRGB) for it's corresponding GenericRGB hex value.
austincondiff commentedon Jan 16, 2024
Sounds good to me!
armartinez commentedon Jan 17, 2024
@austincondiff #1566