Jump to content

PSD.js Font Colour Codes Make No Sense


glenelkins1984

Recommended Posts

Using PSD.js the colours for text characters don't match RGB,RGBA or CMYK, there are 5 numbers in the a colour arrays, they don't even match the text colour in the photoshop file if you try to compare any of the numbers to the RBG or CMYK values.

An example what PSD.js is showing for colours of a particular part of text shows this array:

[3] => Array
(
[0] => 27
[1] => 185
[2] => 116
[3] => 0
[4] => 255
)

You can clearly see these have no relevance to any colour codes I have seen before. These numbers are supposedly representing this colour: #db6971 - but none of the numbers match anything, the RGB for that is 219,105,113 and CMYK is 11%,72%,46%,0%

So does anyone have a clue what is going on here? I am trying to render this text to html but I can't set the colour without actually knowing what these numbers are supposed to mean.

Can't get an answer from the library developer on this.

Link to comment
Share on other sites

Was that off the top of your head, or did you read more of the code than I did?

I just noticed there was a correlation between the 27/185/116/0 and the 11%/72%/46%/0%. PSDs are primarily about printing so CYMK would be more appropriate than RGB.

The final 255 could easily be alpha/opacity.

 

The true answer is probably buried somewhere in the PSD spec but it's not the easiest thing to read through.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

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.