Skip to content
This repository has been archived by the owner on Nov 4, 2022. It is now read-only.

CLR and Sketchpalette inconsistencies #29

Closed
winslet opened this issue Nov 17, 2016 · 19 comments
Closed

CLR and Sketchpalette inconsistencies #29

winslet opened this issue Nov 17, 2016 · 19 comments
Labels

Comments

@winslet
Copy link

winslet commented Nov 17, 2016

I seem to be finding inconsistencies across the board in the hex codes across the CLR vs the Sketchpalette (have not tried the ASE) from the v2.0.

eg. Sketchpalette on left, CLR on right.

screen shot 2016-11-17 at 09 45 48

Aqua 10
Sketchpalette #6AEBF4
CLR #5DE8F1

Yellow Core/10
Sketchpalette #FED500
CLR #FDCE0A

Wondering if these came from the export process for the CLR?

@seejamescode seejamescode self-assigned this Nov 17, 2016
@seejamescode
Copy link
Collaborator

Looks like CLR is the incorrect one! I will see if there is a more reliable tool for the automated process.

@winslet
Copy link
Author

winslet commented Nov 18, 2016

thanks @seejamescode ! if there's any testing I can do to help gimme a shout 👍

@seejamescode
Copy link
Collaborator

I have tried three different shell script and Keynote is still showing the same, wrong hex. Do you notice a pattern in how they are incorrect?

@winslet
Copy link
Author

winslet commented Nov 18, 2016

hmm thats not cool :/ the only trend I can pick out is that they are all slightly darker than their correct counterpart. I know that we have had these problems in the past and we had to change the CLR for the same reasons, it might be worth trying to track down who converted that ASE in the past, @hchughes do you know who modified the last CLR to get it correct?

@ind1go
Copy link
Collaborator

ind1go commented Nov 18, 2016

Could this be something to do with CLR interpreting it according to the Apple gamut which is different to the PC gamut?

And yes, I'm now throwing out random suggestions.

@ind1go
Copy link
Collaborator

ind1go commented Nov 18, 2016

I think what I really meant was that they may be being created in different colour spaces, i.e. sRGB versus AdobeRGB.

@winslet
Copy link
Author

winslet commented Nov 18, 2016

I wonder if we could go from the raw hex values to a CLR rather than through the ASE medium? Eg take the SCSS and put that into a CLR converter?

Im not sure what extra code is dropped in with an ASE to make it Adobe friendly...

@seejamescode
Copy link
Collaborator

I have tried the json2clr and html2clr scripts also and got the exact same result 🙁

@seejamescode
Copy link
Collaborator

It makes me wonder if it is Keynote's interpretation of CLR files. Is there another program you can test with that uses CLR?

@winslet
Copy link
Author

winslet commented Nov 18, 2016

So those above screengrabs came straight from Sketch - as the CLR comes in from the core apple colour picker I fear we will have those problems across the board.

@winslet
Copy link
Author

winslet commented Nov 18, 2016

if we're feeling ambitious - this is the apple docs for the file format: https://developer.apple.com/reference/appkit/nscolorlist

@ind1go
Copy link
Collaborator

ind1go commented Nov 18, 2016

@winslet and I have been doing a bit of investigation...

If you open the colour palette in Keynote (or elsewhere), choose Aqua 10, then go to the sliders tab you'll see the (incorrect) #5DE8F1.

However, if you then use the cog on the sliders tab to change the colour profile from generic RGB to sRGB, it's really really close - just 1 bit out in the red, probably caused by rounding - #6BEBF4.

2016-11-18 16_51_52

It seems like the CLR is defaulting to generic RGB rather than being sRGB. It looks like it's possible to assert that an NSColor is sRGB as you create it: https://developer.apple.com/reference/appkit/nscolor#1891878. But this is all getting rather involved.

@winslet
Copy link
Author

winslet commented Nov 18, 2016

Without wanting to post too many links that I have limited technical knowledge about, this chap has done exactly what we wanted to do but for Pantone Swatches, he even includes the obj-C code at the bottom we could edit: https://www.midwinter-dg.com/permalink-how-I-created-a-set-of-pantone-swatches-for-the-mac-osx-color-picker_2014-08-09.html

@ind1go
Copy link
Collaborator

ind1go commented Nov 18, 2016

OK, those suspicions seems to be reasonably founded - the different libraries you've used, @seejamescode, all seem to use either device or literal colour space, rather than sRGB. I might try forking json2clr to use sRGB.

@ind1go
Copy link
Collaborator

ind1go commented Nov 18, 2016

Got it! I think we want to use the 'calibrated' color space, i.e. the one which produces a NSCalibratedRGBColorSpace. I've managed to get a CLR out with the right hex codes... or at least, for Aqua 10, which is better than before! @seejamescode Do you want to try this out and see if you get the right results? https://github.com/ind1go/json2clr/tree/calibrated

@ind1go
Copy link
Collaborator

ind1go commented Nov 18, 2016

Again, I can make Aqua 10 be produced correctly using Ase2Clr by switching to the calibrated color space - try this: https://github.com/ind1go/ColorTools/tree/calibrated

@seejamescode
Copy link
Collaborator

Nice Ben! Y'all are the real MVPs. @ind1go, can you make a PR with your shell script?

@seejamescode seejamescode removed their assignment Nov 18, 2016
ind1go added a commit to ind1go/colors that referenced this issue Nov 19, 2016
@seejamescode
Copy link
Collaborator

🎉 Thanks @ind1go and @winslet!

@shagadorn
Copy link

@ind1go and @winslet has the clr been updated to reflect the new color space? Still getting problems in keynote with the generic rgb color space.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants