PSD.js font color codes make no sense

I know this question has already been asked here , but there was no answer that makes sense, and the developer is a nightmare to master.

Using PSD.js, the colors for text characters do not match RGB, RGBA or CMYK, there are 5 numbers in the color arrays, they do not even match the color of the text in the Photoshop file if you try to compare any of the numbers to RBG or CMYK values.

An example that shows PSD.js for the colors of a specific piece of text shows this array:

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

You can clearly see that they are not related to the color codes that I saw before. These numbers presumably represent this color: # db6971 - but none of the numbers matches anything, RGB for this is 219,105,113, and CMYK is 11%, 72%, 46%, 0%

- , ? html, , , .

+4
2

GitHub PSD.js repo - https://github.com/meltingice/psd.js/issues/119#issuecomment-346899211

... , - .

const colorArray = [ [ 102, 0, 255, 0, 255 ], [ 102, 0, 255, 0, 255 ]]
const RGB = colorArray.map(([r,g,b]) => [r,g,b]) //[[102,0,255],[102,0,255]] 
+1

CMYK 255 ( ), , (28, 184, 117, 0). , , -() , 255 . , , CMYK + A

:

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

CMYK , , .

.. C ,

255 * C / 100 = 27

C = 27 * 100 / 255 = 10.58 (~= 11%)
M = 185 * 100 / 255 = 72.54 (~= 73%)

.

Y ~= 45%, K = 0%, A = 100%

CMYK (11%, 72%, 46%, 0%), .

, RGB, CMYK RGB ICC ( CMYK RGB, sRGB).

, . , , , Photoshop.

0

Source: https://habr.com/ru/post/1694056/


All Articles