{"id":18031745,"url":"https://github.com/dagronf/colorpalettecodable","last_synced_at":"2025-06-21T07:39:55.281Z","repository":{"id":63907282,"uuid":"492806736","full_name":"dagronf/ColorPaletteCodable","owner":"dagronf","description":"A color palette/gradient reader/writer for a growing set of file formats.  Swift (macOS, iOS, tvOS, watchoOS, macCatalyst, Linux)","archived":false,"fork":false,"pushed_at":"2025-03-16T21:15:41.000Z","size":2287,"stargazers_count":40,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-23T04:31:40.105Z","etag":null,"topics":["aco","adobe","ase","clr","ggr","gradient","ios","macos","nscolorlist","palette","swift","tvos"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dagronf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-16T11:32:32.000Z","updated_at":"2025-03-16T21:15:43.000Z","dependencies_parsed_at":"2024-04-17T05:27:42.450Z","dependency_job_id":"60a853d3-171e-4022-96e1-6374a0715fae","html_url":"https://github.com/dagronf/ColorPaletteCodable","commit_stats":{"total_commits":107,"total_committers":1,"mean_commits":107.0,"dds":0.0,"last_synced_commit":"7b9c52479029e22d217db29b60a7ed90da09524c"},"previous_names":[],"tags_count":87,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dagronf%2FColorPaletteCodable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dagronf%2FColorPaletteCodable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dagronf%2FColorPaletteCodable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dagronf%2FColorPaletteCodable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dagronf","download_url":"https://codeload.github.com/dagronf/ColorPaletteCodable/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245791335,"owners_count":20672665,"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":["aco","adobe","ase","clr","ggr","gradient","ios","macos","nscolorlist","palette","swift","tvos"],"created_at":"2024-10-30T10:10:39.067Z","updated_at":"2025-03-27T05:30:58.959Z","avatar_url":"https://github.com/dagronf.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ColorPaletteCodable\n\nA color palette reader/editor/writer package for iOS, macOS, macCatalyst, tvOS, watchOS and Linux.\n\n![tag](https://img.shields.io/github/v/tag/dagronf/ColorPaletteCodable)\n![Swift](https://img.shields.io/badge/Swift-5.4-orange.svg)\n[![License MIT](https://img.shields.io/badge/license-MIT-magenta.svg)](https://github.com/dagronf/ColorPaletteCodable/blob/master/LICENSE) \n![SPM](https://img.shields.io/badge/spm-compatible-maroon.svg)\n![Build](https://img.shields.io/github/actions/workflow/status/dagronf/ColorPaletteCodable/swift.yml)\n\n\n![macOS](https://img.shields.io/badge/macOS-10.13+-darkblue)\n![iOS](https://img.shields.io/badge/iOS-13+-crimson)\n![tvOS](https://img.shields.io/badge/tvOS-13+-forestgreen)\n![watchOS](https://img.shields.io/badge/watchOS-6+-indigo)\n![macCatalyst](https://img.shields.io/badge/macCatalyst-2+-orangered)\n![Linux](https://img.shields.io/badge/Linux-compatible-peru)\n\nSupports the following :-\n\n## Supported palette formats\n\n* Adobe Swatch Exchange (`.ase`)\n* Adobe Photoshop Color Swatch (`.aco`)\n* Adobe Color Table (`.act`)\n* Adobe Color Book (`.acb`) ***(read only)***\n* NSColorList (`.clr`) ***(macOS only)***\n* RGB text files (`.rgb`)\n* RGBA text files (`.rgba`)\n* GIMP palette files (`.gpl`)\n* OpenOffice/LibreOffice palette files (`.soc`)\n* Paint Shop Pro files (`.pal`, `.psppalette`)\n* Image palette files (`.png`, `.jpg`, `.gif`) (unique colors in the first row of the image)\n* Microsoft RIFF palette files (`.pal`) ***(read only)***\n* SketchPalette files (`.sketchpalette`)\n* CorelDraw/Adobe Illustrator xml palette (`.xml`)\n* Corel swatches (`.txt`)\n* Corel Paint file format (`.cpl`) ***(read only)***\n* JSON encoded color files (`.jsoncolorpalette`) ***ColorPaletteCodable internal file format***\n* Hex Color Palette (text file with delimited hexadecimal color strings) (`.hex`)\n* Paint.NET palette files (`.txt`)\n* SVG swatches (`.svg`) ***(write only)***\n* Basic CSV\n* Basic XML\n* Android `colors.xml` resource file format\n* CLF Lab colors file (`.clf`) ***(read only)***\n\n## Supported gradient formats\n\n* GIMP gradient (`.ggr`)\n* GNUPlot color map (`.gpf`)\n* CPT gradient (`.cpt`)\n* Built-in JSON format gradient (`.jsongradient`)\n* Basic Adobe gradient (`.grd`) ***(read only)***\n* Basic Paint Shop Pro gradient (`.pspgradient`) ***(read only)***\n* SVG Gradient file (`.svg`) ***(write only)***\n\n## Why?\n\nI wanted to be able to read and write Adobe `.ase` palette files in my Swift app. \nThis then extended to `.aco` Adobe Photoshop Color Swatch files.\nWhich then expanded to other types :-)\n\nSome features :-\n\n* Named palettes\n* Named colors\n* Multiple named groups of colors within a single palette\n* Colorspace support (RGB, CMYK, Gray) with conversion capabilities\n* Encoding/Decoding of all supported palette coder types\n* Includes a cross-platorm, human readable, palette coder (json utf8 format)\n* Integrated pasteboard support for macOS/iOS\n* Simple image generation for an collection of colors\n* Gradient support\n\n[Online API Documentation](https://swiftpackageindex.com/dagronf/ColorPaletteCodable/main/documentation/colorpalettecodable)\n\n## Palette API\n\n| Type          | Description                              | \n|:--------------|:-----------------------------------------|\n|`PAL.Palette`  | The full representation of a palette     |\n|`PAL.Group`    | An optionally named collection of colors |\n|`PAL.Color`    | An optionally named color                |\n\n### Available Coders\n\n| Type                              | Description                                 |\n|:----------------------------------|:--------------------------------------------|\n|`PAL.Coder.ACB`                    | Adobe Color Book (.acb)                     |\n|`PAL.Coder.ACO`                    | Adobe Photoshop Color Swatch (.aco)         |\n|`PAL.Coder.ACT`                    | Adobe Color Table (.act)                    |\n|`PAL.Coder.AndroidColorsXML`       | Android `color.xml` resources (.xml)        |\n|`PAL.Coder.ASE`                    | Adobe Swatch Exchange (.ase)                |\n|`PAL.Coder.BasicXML`               | Basic XML structure (.xml)                  |\n|`PAL.Coder.CLF`                    | CLF Lab Colors file (.clf)                  |\n|`PAL.Coder.CLR`                    | NSColorList (.clr) *(macOS only)*           |\n|`PAL.Coder.CorelDrawV3`            | Corel Draw V3 Palette (.pal)                |\n|`PAL.Coder.CorelPainter`           | CorelPainter Swatch (.txt)                  |\n|`PAL.Coder.CorelXMLPalette`        | CorelDraw/Adobe Illustrator Palette (.xml)  |\n|`PAL.Coder.CPL`                    | Corel Paint (.cpl)                          |\n|`PAL.Coder.CSV`                    | CSV (.csv)                                  |\n|`PAL.Coder.DCP`                    | Built-in binary palette format (.dcp)       |\n|`PAL.Coder.GIMP`                   | GIMP palette files (.gpl)                   |\n|`PAL.Coder.HEX`                    | Hex Color Palette (`.hex`)                  |\n|`PAL.Coder.Image`                  | Image files (.png, .jpg, .gif)              |\n|`PAL.Coder.JSON`                   | JSON encoded palette (.jsoncolorpalette)    |\n|`PAL.Coder.OpenOfficePaletteCoder` | OpenOffice Palette (.soc)                   |\n|`PAL.Coder.PaintNET`               | Paint.NET Palette (.txt)                    |\n|`PAL.Coder.PaintShopPro`           | Paint Shop Pro palette (.pal;.psppalette)   |\n|`PAL.Coder.RGBA`                   | RGB(A) text files (.rgba)                   |\n|`PAL.Coder.RGB`                    | RGB text files (.rgb)                       |\n|`PAL.Coder.RIFF`                   | Microsoft RIFF palette (.pal)               |\n|`PAL.Coder.ScribusXMLPaletteCoder` | Scribus XML palette (.xml)                  | \n|`PAL.Coder.SketchPalette`          | Sketch Palette (.sketchpalette)             |\n|`PAL.Coder.SVG`                    | SVG image file (.svg)                       |\n|`PAL.Coder.VGA24BitPaletteCoder`   | 24-bit VGA palette (.pal)                   |\n|`PAL.Coder.VGA18BitPaletteCoder`   | 18-bit VGA palette (.pal)                   |\n\nEach coder defines `.encode` and `.decode`. Not all coders support both encode and decode.\n\n### Example usage\n\n#### Decode a palette file\n\n```swift\ndo {\n   let myFileURL = URL(fileURL: ...)\n   \n   // Try to decode the palette based on its file extension\n   let palette = try PAL.Palette(myFileURL)\n   \n   // do something with 'palette'\n}\ncatch {\n   // Do something with 'error'\n}\n```\n\n#### Build a palette and generate an ASE binary representation\n\n```swift\n// Build a palette\nlet c1 = rgbf(1, 0, 0, name: \"red\")\nlet c2 = rgbf(0, 1, 0, name: \"green\")\nlet c3 = rgbf(0, 0, 1, name: \"blue\")\nvar palette = PAL.Palette()\npalette.colors.append(contentsOf: [c1, c2, c3])\n\n// Generate a simple image from the colors\nlet image = try PAL.Image.Image(colors: [c1, c2, c3], size: CGSize(width: 100, height: 25))\n\n// Simple export using the 'ase' format with default settings\nlet exportedPaletteData = try palette.export(format: .ase)\n\n// Export using a coder (useful when the coder has configuration options)\n// Create an ASE coder\nlet coder = PAL.Coder.ASE()\nlet rawData = try coder.encode(palette)\n   \n// Do something with 'rawData' (like write to a file for example)\n\n```\n\n#### Read an ACO file, write an ASE file\n\n```swift\nlet acoFileURL = URL(fileURL: ...)\nvar palette = try PAL.Palette(acoFileURL)\n\n// ... do something with 'palette' ...\n\n// re-encode the palette to an ASE format\nlet paletteData = palette.export(format: .ase)\n```\n\n### Palette format encoding/decoding limitations\n\n| Type                               | File Type              | Decode?  | Encode?  | Named\u003cbr\u003eColors? | Named\u003cbr\u003epalette? | Color\u003cbr\u003eGroups? | ColorType\u003cbr\u003eSupport? | Supports\u003cbr\u003eColorspaces? | Supports Alpha? |\n|:-----------------------------------|:-----------------------|:---------|:---------|:-----------------|:------------------|:-----------------|:----------------------|:-------------------------|:----------------|\n| `PAL.Coder.ACB`                    | Binary                 | ✅       | ❌       | ✅              | ❌                | ❌               | ❌                     | ✅                     | ❌               |\n| `PAL.Coder.ACO`                    | Binary                 | ✅       | ✅       | ✅              | ❌                | ❌               | ❌                     | ✅                     | ❌               |\n| `PAL.Coder.ACT`                    | Binary                 | ✅       | ✅       | ❌              | ❌                | ❌               | ❌                     | RGB only               | Decode only     |\n| `PAL.Coder.AndroidColorsXML`       | XML                    | ✅       | ✅       | ✅              | ❌                | ❌               | ❌                     | RGB only               | ✅               |\n| `PAL.Coder.ASE`                    | Binary                 | ✅       | ✅       | ✅              | ❌                | ✅               | ✅                     | ✅                     | ❌               |\n| `PAL.Coder.BasicXML`               | XML                    | ✅       | ✅       | ✅              | ✅                | ❌               | ❌                     | RGB only               | ✅               |\n| `PAL.Coder.CLF`                    | Text                   | ✅       | ❌       | ✅              | ❌                | ❌               | ❌                     | LAB only               | ❌               |\n| `PAL.Coder.CLR`                    | Binary\u003cbr\u003e(macOS only) | ✅       | ✅       | ✅              | ❌                | ❌               | ❌                     | ✅                     | ✅               |\n| `PAL.Coder.CorelDrawV3`            | Text                   | ✅       | ✅       | ✅              | ❌                | ❌               | ❌                     | CMYK only              | ❌               |\n| `PAL.Coder.CorelPainter`           | Text                   | ✅       | ✅       | ✅              | ❌                | ❌               | ❌                     | RGB only               | ❌               |\n| `PAL.Coder.CPL`                    | Binary                 | ✅       | ❌       | ✅              | ✅                | ❌               | ✅                     | ✅                     | ❌               |\n| `PAL.Coder.CSV`                    | Text                   | ✅       | ✅       | ✅              | ❌                | ❌               | ❌                     | RGB only               | ✅               |\n| `PAL.Coder.DCP`                    | Binary                 | ✅       | ✅       | ✅              | ✅                | ✅               | ✅                     | ✅                     | ✅               |\n| `PAL.Coder.GIMP`                   | Text                   | ✅       | ✅       | ✅              | ✅                | ❌               | ❌                     | RGB only               | ❌               |\n| `PAL.Coder.HEX`                    | Text                   | ✅       | ✅       | ❌              | ❌                | ❌               | ❌                     | RGB only               | ✅               |\n| `PAL.Coder.Image`                  | Binary                 | ✅       | ✅       | ❌              | ❌                | ❌               | ❌                     | ❌                     | ✅               |\n| `PAL.Coder.JSON`                   | JSON Text              | ✅       | ✅       | ✅              | ✅                | ✅               | ✅                     | ✅                     | ✅               |\n| `PAL.Coder.OpenOfficePalette`      | XML                    | ✅       | ✅       | ✅              | ❌                | ❌               | ❌                     | ❌                     | ❌               |\n| `PAL.Coder.PaintNET`               | Text                   | ✅       | ✅       | ❌              | ❌                | ❌               | ❌                     | RGB only               | ✅               |\n| `PAL.Coder.PaintShopPro`           | Text                   | ✅       | ✅       | ❌              | ❌                | ❌               | ❌                     | RGB only               | ❌               |\n| `PAL.Coder.RGB/A`                  | Text                   | ✅       | ✅       | ✅              | ❌                | ❌               | ❌                     | RGB only               | ✅               |\n| `PAL.Coder.RIFF`                   | Binary                 | ✅       | ❌       | ❌              | ❌                | ❌               | ❌                     | RGB only               | ❌               |\n| `PAL.Coder.ScribusXMLPaletteCoder` | XML                    | ✅       | ✅       | ✅              | ✅                | ❌               | ❌                     | RGB/CMYK only          | ❌               |\n| `PAL.Coder.SketchPalette`          | XML                    | ✅       | ✅       | ❌              | ❌                | ❌               | ❌                     | RGB only               | ✅               |\n| `PAL.Coder.SVG`                    | SVG text               | ❌       | ✅       | ❌              | ✅                | ✅               | ❌                     | RGB only               | ✅               |\n| `PAL.Coder.VGA24BitPaletteCoder`   | Binary                 | ✅       | ✅       | ❌              | ❌                | ❌               | ❌                     | RGB only               | ❌               |\n| `PAL.Coder.VGA18BitPaletteCoder`   | Binary                 | ✅       | ✅       | ❌              | ❌                | ❌               | ❌                     | RGB only               | ❌               |\n\n*(A ColorType represents the type of color (global/spot/normal))*\n\n## Gradients\n\nThe library defines `PAL.Gradients` which defines a collection of colors with positions\nthat can be used when using a gradient.  Certain gradient types (eg. `.grd`) support multiple \ngradients within the same file.\n\n\n### TL; DR - Show me how?\n\n```Swift\n/// Load gradients from a file, (using the fileURL to determine the gradients type)\nlet fileURL = /* some gradient fileURL */\nlet gradients = try PAL.Gradients(fileURL)\n\n/// Load gradients from raw data, assuming the format is cpt\nlet gradients2 = try PAL.Gradients(data, format: .cpt)\n\n/// Save a gradient file using a file extension\nlet fileData = try gradients2.export(gradients, fileExtension: \"dcg\")\n\n/// Save a gradient file using a file extension\nlet fileData2 = try gradients2.export(gradients, format: .dcg)\n\n/// Use a specific coder to load a gradient with parameters\nlet coder = PAL.Gradients.Coder.DCG()\nlet gradients2 = try coder.decode()\n```\n\n## Gradient API\n\n| Type                   | Description                            | \n|:-----------------------|:---------------------------------------|\n|`PAL.Gradients`         | A collection of gradients              |\n|`PAL.Gradient`          | A gradient                             |\n|`PAL.Stop`              | A color stop within a gradient         |\n|`PAL.TransparencyStop`  | A transparency stop within a gradient  |\n\n### Available Coders\n\n|                            |                                                   |          |          |          |                  |\n|:---------------------------|:--------------------------------------------------|:---------|:---------|:---------|:-----------------|\n| Type                       | Description                                       | Format   | Decode?  | Encode?  | Supports Alpha ? |\n| `PAL.Gradients.Coder.CPT`  | CPT gradient file (.cpt)                          | text     | ✅        | ✅        | ❌                |\n| `PAL.Gradients.Coder.DCG`  | Built-in format (.grd)                            | binary   | ✅        | ✅        | ✅                |\n| `PAL.Gradients.Coder.GGR`  | GIMP gradient file (.ggr)                         | text     | ✅        | ✅        | ✅                |\n| `PAL.Gradients.Coder.GPF`  | GNUPlot color palette file (.gpf)                 | text     | ✅        | ✅        | ✅                |\n| `PAL.Gradients.Coder.GRD`  | Basic Adobe Photoshop gradient file (.grd)        | binary   | ✅        | ❌        | ❌                |\n| `PAL.Gradients.Coder.JSON` | Built-in JSON format (.jsongradient)              | json     | ✅        | ✅        | ✅                |\n| `PAL.Gradients.Coder.PSP`  | Basic Paint Shop Pro gradient file (.pspgradient) | text     | ✅        | ❌        | ❌                |\n| `PAL.Gradients.Coder.SVG`  | SVG file (.svg)                                   | text     | ❌        | ✅        | ✅                |\n\n* `.gpf` only supports rgb\n* `.ggr` support doesn't respect segment blending functions other than linear (always imported as linear)\n* `.ggr` support doesn't allow for segment coloring functions other than rgb (throws an error)\n* `.grd` support is _very_ basic at this point. There's no formal document for it, and I built this using very \nvague documents [1](http://www.selapa.net/swatches/gradients/fileformats.php), [2]()\n  * doesn't (currently) support encode\n  * Only user colors are supported in the gradients (ie. book colors aren't supported)\n  * Noise gradients aren't supported\n  * only rgb, cmyk, hsb, gray colors are supported\n* `.pspgradient` _appears_ to be equal to the grd v3 format. (Read only)\n\nFor some nice gradient files\n\n* [cptcity](http://seaviewsensing.com/pub/cpt-city/) has all of them :-)\n* [lospec](https://lospec.com/palette-list)\n\ncptcity also has a [nice converter](http://seaviewsensing.com/pub/cptutils-online/convert/select.html) for gradients to ggr\n\n### Examples\n\n#### Create a gradient\n\n```swift\nlet gradient = PAL.Gradient(\n   colorPositions: [\n      (0.0, try PAL.Color(hexString: \"#FFFFFF\", format: .rgb)),\n      (0.5, try PAL.Color(hexString: \"#444444\", format: .rgb)),\n      (1.0, try PAL.Color(hexString: \"#000000\", format: .rgb))\n   ]\n)\n\n// Create the appropriate coder\nlet coder = PAL.Gradients.Coder.GGR()\n\n// Encode the gradient using the GIMP gradient encoder\nlet data = try coder.encode(gradient)\n\n// Decode a gradient from raw data\nlet decoded = try PAL.Gradients(data, format: .ggr)\n```\n\n#### Load a gradient\n\n```swift\n// Load a gradient from a file, inferring the type from the file's extension\nlet gradient1 = try PAL.Gradients(fileURL)\n\n// Load a specific gradient format from a file\nlet coder = PAL.Gradients(fileURL, format: .grd)\nlet gradient2 = try coder.decode(from: i)\n```\n\n## Color\n\nThis library supports `RGB`, `CMYK`, `LAB` and `Gray` colorspaces\n\n```swift\n/// Create an RGB color\nlet rgb1 = rgbf(1.0, 1.0, 0.5, 0.2, name: \"Lemon Curd\")\n/// Create a gray color\nlet gray1 = grayf(0.2, 1.0, name: \"Dark Gray\")\n```\n\n## Palette Viewer\n\nPalette Viewer allows you to view the contents of all supported palette and gradient files\n\nYou can drag colors out of the preview window into applications that support dropping of `NSColor` instances.\n\nYou can also save the palette to a new format (eg. saving a gimp `.gpl` format to an Adobe `.aco` format)\n\n### QuickLook support\n\nThis package also includes a Quicklook Plugin for palette and gradient files.\n\nIn the `Quicklook` subfolder you'll find an `xcodeproj` which you can use to build the application `Palette Viewer` which contains the QuickLook plugin.\n\nFor the plugin to register, you need to run the application. After the first run the QuickLook plugin will be registered.\n\n## Linux support\n\n* Linux only supports very naive color conversions between RGB-CMYK-Gray.\n\n### To build/test linux support using a mac\n\nSee: [Testing Swift packages on Linux using Docker](https://oleb.net/2020/swift-docker-linux/)\n\n1. Install [Docker Desktop for Mac](https://www.docker.com/products/docker-desktop) on your mac\n2. Make sure that docker is running (or else the next command will fail with a weird or no error message)\n3. Run the following command in the directory you want to mirror in your linux \n\t\n```bash\ndocker run --rm --privileged --interactive --tty --volume \"$(pwd):/src\" --workdir \"/src\" swift:latest\n```\n\nNow, from within the docker container, run \n\n```bash\nswift build\nswift test\n```\n\nNote that the /src directory in the Linux container is a direct mirror of the current directory on the host OS, not a copy. If you delete a file in /src in the Linux container, that file will be gone on the host OS, too.\n\n## Format specs\n\nMany thanks to [https://www.selapa.net/swatches/colors/fileformats.php](https://www.selapa.net/swatches/colors/fileformats.php) \n[(archive.org)](https://web.archive.org/web/20250320193326/https://www.selapa.net/swatches/colors/fileformats.php)\nfor so much useful information.\n\nThe `.ase` file format is not formally defined, however there are a number of deconstructions available on the web.\nI used the breakdown of the format defined [here](http://www.selapa.net/swatches/colors/fileformats.php#adobe_ase).\n\nThe `.aco` file format is defined [here](https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/#50577411_pgfId-1055819).\n\nThe `.act` file format is defined [here](https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/#50577411_pgfId-1070626).\n\nThe `.acb` format discussed and deined [here](https://magnetiq.ca/pages/acb-spec/)\n\nThe CorelDraw/Adobe Illustrator `.xml` file format is (somewhat) defined [here](https://community.coreldraw.com/sdk/w/articles/177/creating-color-palettes)\n\n### GRD references\n\n* [http://www.selapa.net/swatches/gradients/fileformats.php](http://www.selapa.net/swatches/gradients/fileformats.php)\n* [https://github.com/Balakov/GrdToAfpalette/blob/master/palette-js/load_grd.js](https://github.com/Balakov/GrdToAfpalette/blob/master/palette-js/load_grd.js)\n* [https://github.com/abought/grd_to_cmap/blob/master/grd_reader.py](https://github.com/abought/grd_to_cmap/blob/master/grd_reader.py)\n* [https://github.com/tonton-pixel/json-photoshop-scripting/tree/master/Documentation/Photoshop-Gradients-File-Format#descriptor](https://github.com/tonton-pixel/json-photoshop-scripting/tree/master/Documentation/Photoshop-Gradients-File-Format#descriptor)\n\n### Temperature references\n\n* Based on Neil Bartlett's implementation of Mitchell Charity's color temperature work\n* Original data and calculations by Mitchell Charity [http://www.vendian.org/mncharity/dir3/blackbody/](http://www.vendian.org/mncharity/dir3/blackbody/)\n\n- [https://tannerhelland.com/2012/09/18/convert-temperature-rgb-algorithm-code.html](https://tannerhelland.com/2012/09/18/convert-temperature-rgb-algorithm-code.html)\n- [https://andi-siess.de/rgb-to-color-temperature/](https://andi-siess.de/rgb-to-color-temperature/)\n\n## License\n\n```\nMIT License\n\nCopyright (c) 2025 Darren Ford\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n\n## Additional licenses\n\n### OkLab\n\n[https://bottosson.github.io/posts/oklab/#oklab-implementations](https://bottosson.github.io/posts/oklab/#oklab-implementations)\n\n[https://bottosson.github.io/misc/License.txt](https://bottosson.github.io/misc/License.txt)\n\n```\nCopyright (c) 2020 Björn Ottosson\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdagronf%2Fcolorpalettecodable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdagronf%2Fcolorpalettecodable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdagronf%2Fcolorpalettecodable/lists"}