ramonpoca / ColorTools

Tools for color management in Mac OS X and iOS, supporting Adobe Swatch Exchange and NSColorList formats
MIT License
245 stars 19 forks source link

Color profile #4

Closed RaphyRaph closed 9 years ago

RaphyRaph commented 9 years ago

Would there be a way to set a color profile when converting color swatches? Right now it defaults to generic RGB but I'd like to set it to sRGB.

ramonpoca commented 9 years ago

In which tool? SwatchInstall or the command line ones?

RaphyRaph commented 9 years ago

SwatchInstall

ramonpoca commented 9 years ago

ASE files come with no colorspace information, so we assume generic. You can patch Ase2Clr/RPCAdobeSwatchExchange.m:69 to use a different NSColor constructor (like it's done for the CMYK values, for example).

RaphyRaph commented 9 years ago

I tried to get in there and apply a sRGB color space it to the html2clr command and build it, but I failed because my coding skills are limited. Do you think you could share a version of html2clr that applies the sRGB color space?

ramonpoca commented 9 years ago

You just have to patch ColorTools/Html2Clr/NSColor+Hexadecimal.m:58 Replace colorWithRed by colorWithSRGBRed and build.

RaphyRaph commented 9 years ago

Cool thx!! On Tue, Jan 27, 2015 at 3:36 AM Ramon Poca notifications@github.com wrote:

You just have to patch ColorTools/Html2Clr/NSColor+Hexadecimal.m:58 Replace colorWithRed by colorWithSRGBRed and build.

— Reply to this email directly or view it on GitHub https://github.com/ramonpoca/ColorTools/issues/4#issuecomment-71632948.

RaphyRaph commented 9 years ago

Doesn't seem to work. Just defaults to generic rgb. screen shot 2015-01-27 at 12 40 57 pm

ramonpoca commented 9 years ago

That's your colorpicker working space, not the palette. If you change it you'll see the values of red, green and blue change to the selected colorspace. For example, set to sRGB, select r=40,g=40,b=40. Then change to Generic RGB and you'll see the values change to (30,30,30).

So sRGB(40,40,40) = GenericRGB(30,30,30). If your origin palette is in a sRGB colorspace and has #282828 (40,40,40), and you import it with the modified html2clr, it will show as (30,30,30) on the Generic RGB colorspace.

RaphyRaph commented 9 years ago

Got it. Then, how do I export a sRGB palette?

— Raphaël

On Wed, Jan 28, 2015 at 2:20 AM, Ramon Poca notifications@github.com wrote:

That's your colorpicker working space, not the palette. If you change it you'll see the values of red, green and blue change to the selected colorspace. For example, set to sRGB, select r=40,g=40,b=40. Then change to Generic RGB and you'll see the values change to (30,30,30). So sRGB(40,40,40) = GenericRGB(30,30,30).

If your origin palette is in a sRGB colorspace and has #282828 (40,40,40), and you import it with the modified html2clr, it will show as (30,30,30) on the Generic RGB colorspace.

Reply to this email directly or view it on GitHub: https://github.com/ramonpoca/ColorTools/issues/4#issuecomment-71811092

ramonpoca commented 9 years ago

What are you trying to do?

RaphyRaph commented 9 years ago

I'm trying to export a set of hex values into a .clr file where the RGB values are set as sRGB by default. On Thu, Jan 29, 2015 at 12:12 AM Ramon Poca notifications@github.com wrote:

What are you trying to do?

— Reply to this email directly or view it on GitHub https://github.com/ramonpoca/ColorTools/issues/4#issuecomment-71985461.

ramonpoca commented 9 years ago

If your origin hex values are COORDINATES IN THE sRGB COLORSPACE, and you import them as sRGB values (with the patched version of html2clr, creating the UIColor over the sRGB colorspace), then the colors in the .clr file will point the same perceptual color. Do you see a disparity between the hex coordinates and the loaded colors?