How to get CMYK color profiles list?

Hi. For my UXP plugin i need a list of installed CMYK ICM color profiles.

  1. How can i get a list of installed color profiles? I can gen it from C:\Windows\System32\spool\drivers\color but I don’t know how to read this folder from uxp and may be someone know another way?

  2. How to filter only CMYK profiles?

PS. I found “get color profiles”, but… it can sow only RGB or Gray color profiles…
https://developer.adobe.com/photoshop/uxp/2022/ps_reference/media/imaging/

@Kochevnik Did You find a solution?
I’d be interested, too.
Any hints a welcome! Thanks!

I use this parser
https://github.com/lovell/icc
It won’t work right away under UXP, because it uses Buffer, which is not in UXP. Here, instead, it’s ArrayBuffer

First, you need to add Buffer
https://github.com/feross/buffer

import { Buffer } from 'buffer/'

And convert ArrayBuffer to Buffer

const buffer = Buffer.from(arrayBuffer)

And then it works

const profilesFolder = '/Library/ColorSync/Profiles' // macos
const contents = await fs.readdir(profilesFolder)
// first icc file fo example
const file = path.join(profilesFolder, contents[0])

const profileData = fs.readFileSync(file);

// ArrayBuffer to Buffer
const buffer = Buffer.from(profileData)

const profile = parse(buffer);
console.log(profile);
{ version: '2.0',
  intent: 'Perceptual',
  deviceClass: 'Monitor',
  colorSpace: 'RGB',
  connectionSpace: 'XYZ',
  description: 'sRGB IEC61966-2-1 black scaled',
  deviceModelDescription: 'IEC 61966-2-1 Default RGB Colour Space - sRGB',
  viewingConditionsDescription: 'Reference Viewing Condition in IEC 61966-2-1',
  copyright: 'Copyright International Color Consortium'
}