{"id":16990830,"url":"https://github.com/blenderskool/ase-swatch","last_synced_at":"2025-04-12T04:12:31.698Z","repository":{"id":57495815,"uuid":"403008021","full_name":"blenderskool/ase-swatch","owner":"blenderskool","description":"Create Adobe Swatch Exchange (ASE) Files for colors and palette","archived":false,"fork":false,"pushed_at":"2021-09-04T09:08:51.000Z","size":5,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T04:12:26.837Z","etag":null,"topics":["ase","create","library","palette","swatch"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/ase-swatch","language":"Rust","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/blenderskool.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}},"created_at":"2021-09-04T08:48:24.000Z","updated_at":"2024-12-15T15:03:17.000Z","dependencies_parsed_at":"2022-08-28T17:41:13.856Z","dependency_job_id":null,"html_url":"https://github.com/blenderskool/ase-swatch","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blenderskool%2Fase-swatch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blenderskool%2Fase-swatch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blenderskool%2Fase-swatch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blenderskool%2Fase-swatch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blenderskool","download_url":"https://codeload.github.com/blenderskool/ase-swatch/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248514205,"owners_count":21116903,"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":["ase","create","library","palette","swatch"],"created_at":"2024-10-14T03:23:52.180Z","updated_at":"2025-04-12T04:12:31.673Z","avatar_url":"https://github.com/blenderskool.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ase-swatch\n\nRust and WebAssembly library to encode and create Adobe Swatch Exchange (ASE) files for colors and palettes.\n\nThis project is based on the [swatch](https://github.com/nsfmc/swatch) library by Marcos A Ojeda written in Python.\n\n## Usage\n\n### In Rust\n\n```rust\nuse ase_swatch::create_ase;\nuse ase_swatch::types::*;\n\nlet swatches = vec![\n    ObjectSwatch {\n        name: \"Palette 1\".to_string(),\n        swatches: vec![\n            ObjectColor {\n                name: \"Red\".to_string(),\n                object_type: ObjectColorType::Global,\n                data: Color {\n                    mode: ColorMode::Rgb,\n                    values: vec![1.0, 0.0, 0.0],\n                },\n            },\n            ObjectColor {\n                name: \"Green\".to_string(),\n                object_type: ObjectColorType::Global,\n                data: Color {\n                    mode: ColorMode::Rgb,\n                    values: vec![0.0, 1.0, 0.0],\n                },\n            },\n            ObjectColor {\n                name: \"Blue\".to_string(),\n                object_type: ObjectColorType::Global,\n                data: Color {\n                    mode: ColorMode::Rgb,\n                    values: vec![0.0, 0.0, 1.0],\n                },\n            },\n        ],\n    }\n];\nlet colors = vec![\n    ObjectColor {\n        name: \"Blue\".to_string(),\n        object_type: ObjectColorType::Global,\n        data: Color {\n            mode: ColorMode::Rgb,\n            values: vec![0.0, 0.0, 1.0],\n        },\n    },\n];\nlet result: Vec\u003cu8\u003e = create_ase(\u0026swatches, \u0026colors);\n// resulting vector of bytes can be written as a binary file\n```\n\n### In JavaScript\n\n**Prerequisite steps:**\n\n- Clone the repo\n- Build a WebAssembly binary using [`wasm-pack`](https://rustwasm.github.io/wasm-pack/) with appropriate build target.\n\nThe library exposes a `create_ase_js()` function that can be called from JavaScript with a similar signature to `create_ase` function.\n\n```javascript\nconst swatches = [\n  {\n    name: \"Palette 1\",\n    swatches: [\n      {\n        name: \"Red\",\n        object_type: \"Global\",\n        data: {\n          mode: \"Rgb\",\n          values: [1.0, 0.0, 0.0],\n        },\n      },\n      {\n        name: \"Green\",\n        object_type: \"Global\",\n        data: {\n          mode: \"Rgb\",\n          values: [0.0, 1.0, 0.0],\n        },\n      },\n      {\n        name: \"Blue\",\n        object_type: \"Global\",\n        data: {\n          mode: \"Rgb\",\n          values: [0.0, 0.0, 1.0],\n        },\n      },\n    ],\n  },\n];\nlet colors = [\n  {\n    name: \"Blue\",\n    object_type: \"Global\",\n    data: {\n      mode: \"Rgb\",\n      values: [0.0, 0.0, 1.0],\n    },\n  },\n];\nconst result = create_ase_js(swatches, colors);\n// resulting array is a `Uint8Array` of the created ASE file\n```\n\n## License\nase-swatch is [MIT Licensed](./LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblenderskool%2Fase-swatch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblenderskool%2Fase-swatch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblenderskool%2Fase-swatch/lists"}