{"id":16713035,"url":"https://github.com/atesgoral/acb","last_synced_at":"2025-03-23T14:31:52.739Z","repository":{"id":42627916,"uuid":"52743811","full_name":"atesgoral/acb","owner":"atesgoral","description":"Adobe Photoshop Color Book (ACB) encoder and decoder","archived":false,"fork":false,"pushed_at":"2023-01-07T09:58:07.000Z","size":236,"stargazers_count":13,"open_issues_count":8,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-18T21:50:47.082Z","etag":null,"topics":["acb","adobe","color","photoshop"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/atesgoral.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-28T20:58:28.000Z","updated_at":"2024-12-26T05:11:03.000Z","dependencies_parsed_at":"2023-02-06T20:46:42.429Z","dependency_job_id":null,"html_url":"https://github.com/atesgoral/acb","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atesgoral%2Facb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atesgoral%2Facb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atesgoral%2Facb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atesgoral%2Facb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atesgoral","download_url":"https://codeload.github.com/atesgoral/acb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245116030,"owners_count":20563267,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["acb","adobe","color","photoshop"],"created_at":"2024-10-12T20:45:17.940Z","updated_at":"2025-03-23T14:31:52.409Z","avatar_url":"https://github.com/atesgoral.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# acb\n\n[![npm (scoped)](https://img.shields.io/npm/v/@atesgoral/acb)][1]\n[![CI](https://github.com/atesgoral/acb/actions/workflows/ci.yml/badge.svg)][2]\n[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)][3]\n\n[1]: https://www.npmjs.com/package/@atesgoral/acb\n[2]: https://github.com/atesgoral/acb/actions/workflows/ci.yml\n[3]: http://www.typescriptlang.org/\n\nAdobe Photoshop Color Book (ACB) encoder and decoder.\n\n## What\n\nAdobe Photoshop's color picker allows you to pick colors from standard color\nlibraries. These libraries reside as .acb files inside Photoshop's installation\ndirectory (e.g. /Applications/Adobe Photoshop/Presets/Color Books on macOS).\nThis library allows you to decode and encode .acb files. You can extract color\ndata from Photoshop's color books, as well as creating your own custom color\nbooks you can use them yourself or distribute them.\n\n![image](https://user-images.githubusercontent.com/50832/130333639-adf72cc4-0aad-4621-b447-06a381684117.png)\n\n## Install\n\n```sh\nnpm install @atesgoral/acb\n# Or:\nyarn add @atesgoral/acb\n```\n\n## Book structure\n\nThe output from the decoder and the expected input into the decoder looks\nsomething like this:\n\n```js\nconst book = {\n  id: 42,\n  title: 'Primary colors',\n  description: 'Primary light colors, as perceived by humans.',\n  colorNamePrefix: '',\n  colorNamePostfix: '',\n  pageSize: 3,\n  pageKey: 1,\n  colorModel: 'RGB',\n  colors: [\n    {name: 'Red', code: 'RED   ', components: [255, 0, 0]},\n    {name: 'Green', code: 'GREEN ', components: [0, 255, 0]},\n    {name: 'Blue', code: 'BLUE  ', components: [0, 0, 255]},\n  ],\n};\n```\n\nIf you're using TypeScript, there is a `ColorBook` interface that is exported by\nthe library:\n\n```ts\nimport type {ColorBook} from '@atesgoral/acb';\n\nconst book: ColorBook = {\n  // ...\n};\n```\n\nAll properties are mandatory:\n\n\u003c!-- markdownlint-disable line-length --\u003e\n\n|      field       | description                                               |\n| :--------------: | --------------------------------------------------------- |\n|        id        | The unique color book identifier. You must ensure that    |\n|                  | this does not conflict with an existing color book that   |\n|                  | exists in Photoshop's color book folder. Stock Photoshop  |\n|                  | color books seem to start at id 3000.                     |\n|      title       | The color book title. Photoshop seems to show the         |\n|                  | filename instead of this.                                 |\n|   description    | The color book description. Photoshop doesn't show this   |\n|                  | anywhere. Use `'^R'` for the registered trademark symbol  |\n|                  | (\u0026reg;) and `'^C'` for the copyright symbol (\u0026copy;).     |\n| colorNamePrefix  | The prefix to prepend to every color name.                |\n| colorNamePostfix | The suffix to append to every color name.                 |\n|     pageSize     | The number of colors to show on every color page in the   |\n|                  | library color picker. The maximum that Photoshop allows   |\n|                  | is 9.                                                     |\n|     pageKey      | Which color (by index) on a page to use as the color page |\n|                  | key. For example, with 9 colors per page, 5 would be the  |\n|                  | middle of the page color.                                 |\n|    colorModel    | The color model of the color book. Valid values are:      |\n|                  |                                                           |\n|                  | \\* `'RGB'`                                                |\n|                  | \\* `'CMYK'`                                               |\n|                  | \\* `'Lab'`                                                |\n|                  |                                                           |\n|                  | (`import type {ColorModel} from '@atesgoral/acb';`)       |\n|      colors      | And array of color records.                               |\n\n\u003c!-- markdownlint-enable line-length --\u003e\n\nEach color record (`import type {Color} from '@atesgoral/acb';`) consists of the\nfollowing mandatory properties:\n\n\u003c!-- markdownlint-disable line-length --\u003e\n\n|   field    | description                                                     |\n| :--------: | --------------------------------------------------------------- |\n|    name    | The color name.                                                 |\n|    code    | A 6-character unique code for the color.                        |\n| components | An array of component values. For RGB, it's 3 values 0..255.    |\n|            | For CMYK it's 4 values 0..100. For Lab the L component is       |\n|            | 0..100 while a and b are -128..127. (All ranges are inclusive.) |\n\n\u003c!-- markdownlint-enable line-length --\u003e\n\n## Decoding examples\n\n### Decoding from the standard input stream\n\n```js\nimport {AcbStreamDecoder} from '@atesgoral/acb';\n\nconst decoder = new AcbStreamDecoder();\n\ndecoder.on('book', (book) =\u003e {\n  console.log(JSON.stringify(book, null, 2));\n});\n\ndecoder.on('error', (error) =\u003e console.error(error));\n\nprocess.stdin.pipe(decoder).pipe(process.stdout);\n```\n\n### Decoding from a buffer\n\n```js\nimport {Readable} from 'stream';\n\nimport {AcbStreamDecoder} from '@atesgoral/acb';\n\nconst decoder = new AcbStreamDecoder();\n\ndecoder.on('book', (book) =\u003e {\n  console.log(JSON.stringify(book, null, 2));\n});\n\ndecoder.on('error', (error) =\u003e console.error(error));\n\nconst buffer = fs.readFileSync('./book.acb');\n\nReadable.from(buffer).pipe(decoder).pipe(process.stdout);\n```\n\n## Encoding examples\n\n`encodeAcb` is a generator that yields Buffer chunks.\n\n### Encoding to the standard output stream\n\n```js\nimport {Readable} from 'stream';\n\nimport {encodeAcb} from '@atesgoral/acb';\n\nconst book = {\n  // ...\n};\n\nconst readable = Readable.from(encodeAcb(book));\nreadable.pipe(process.stdout);\n```\n\n### Encoding into a single Buffer\n\n```js\nimport {encodeAcb} from '@atesgoral/acb';\n\nconst book = {\n  // ...\n};\n\nconst buffer = Buffer.concat([...encodeAcb(book)]);\n```\n\n## Background\n\nI [reverse-engineered the ACB format][4] back in 2003 before [Adobe had it\npublished publicly][5]. I've been creating custom color books on the side for\nartists, printers and ink manifacturers. I've finally gotten around to publicly\npublishing a library that everyone can use.\n\n[4]: https://magnetiq.ca/pages/acb-spec/\n[5]: https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/#50577411_pgfId-1066780\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatesgoral%2Facb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatesgoral%2Facb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatesgoral%2Facb/lists"}