Jump to content

Color palette CLR file export results in broken, inconsistent, changed colors in Pages/Keynote etc.


Recommended Posts

Hi,
After 3 hours of debugging I want to share my learnings with the development team of Affinity.

1. I created a global palette in Affinity.

2. I exported this palette as a. CLR file

3. I wanted to use these brand colors in Apple Pages and Keynote so I opened this CLR file in the Mac Color Picker there.

4. I noticed that all colors have been changed and shifted. They are no longer the same colors and they no longer have the same color values. That is right. The color values in RGB have been shifted. These are not the defined colors in Affinity.

5. Typing in the values that Affinity shows manually results in the same color.

6. Exporting the colors as CLR from Sketch and Zeplin results in correct colors. It's only from Affinity Designer that colors are shifted.

This must be some kind of color management issue from Affinity Designer. I have the file set to standard SRGB.

How can I export the palette for global use across MacOS without color shifting?
 

Link to comment
Share on other sites

Well I can't tell you how Affinity internally handles or writes out the color values for CLR files here, but usually a MacOS CLR file is just a serialized NSColorList object (see also the AppKit NSColorList class). So this means in more detail that single colors are defined in an OSX related NSColor object, which in turn is then added to a NSColorList object, the later as it's name implies is a container for holding colors objects and a CLR file is a serialized representation of that NSColorList object contents. - There are a bunch of tools which can read/inspect/convert etc. CLR files, it's pretty easy to handle those in/from ObjC/Swift code.

Some references:

So if colors are shifted when saved out from Affinity (I didn't tested), they might have been defined or written from another used color space (thus possibly different color values can occur), or colors values are internally then wrong converted or represented/hold in NSColorList objects.

☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan
☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2

Link to comment
Share on other sites

Here's a quick proof of the above said, namely that the contents of a CLR file is just a serialized AppKit NSColorList object. - I accessed an example CLR file in a Swift playground and iterated over the colors in the NSColorList, so to say inspecting and printing out it's color contents.

clr_file_inspect.thumb.jpg.88f37250ea80df3b4744a8efce95fd05.jpg

 

☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan
☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2

Link to comment
Share on other sites

7 hours ago, Aloof said:

I noticed that all colors have been changed and shifted. They are no longer the same colors and they no longer have the same color values. That is right. The color values in RGB have been shifted.

The color values will shift depending on the color space set in the Apple Color Picker (ACP for short) in the Sliders pane. This is true no matter what app generated the .clr file.

This is explained in the The Macintosh OS X Color Picker article @v_kyr mentioned. The appearance of the ACP has changed since that article was written, but otherwise the info in the "To Set the Color Space for a Swatch" topic contains the relevant info.

All 3 1.10.8, & all 3 V2.5.6 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
A
ll 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

  • 4 weeks later...

If this was the case, how would it be possible that importing colors through Sketch and Zeplin results in correct colors? Sorry, I am not a developer so I don't really understand your code or the rather technical explanation. All I see is that I have an SRGB file and colors get shifted in Keynote even when I select the exact same color profile.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.