{"id":18352396,"url":"https://github.com/limpix31/themd","last_synced_at":"2025-04-10T00:38:26.308Z","repository":{"id":183135458,"uuid":"657605692","full_name":"LIMPIX31/themd","owner":"LIMPIX31","description":"Make anything match your color symphony","archived":false,"fork":false,"pushed_at":"2023-06-23T18:26:20.000Z","size":27460,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T00:38:17.018Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/LIMPIX31.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-06-23T12:32:08.000Z","updated_at":"2023-06-23T19:24:25.000Z","dependencies_parsed_at":"2024-02-19T09:15:14.989Z","dependency_job_id":null,"html_url":"https://github.com/LIMPIX31/themd","commit_stats":null,"previous_names":["limpix31/themd"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LIMPIX31%2Fthemd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LIMPIX31%2Fthemd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LIMPIX31%2Fthemd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LIMPIX31%2Fthemd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LIMPIX31","download_url":"https://codeload.github.com/LIMPIX31/themd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248138008,"owners_count":21053775,"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":[],"created_at":"2024-11-05T21:35:49.923Z","updated_at":"2025-04-10T00:38:26.283Z","avatar_url":"https://github.com/LIMPIX31.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Themd — theme tool\n\u003cimg width=\"1000\" alt=\"Frame 1\" src=\"https://github.com/LIMPIX31/themd/assets/81296950/00d62d08-a5be-42c9-9454-efd8f4e732c9\"\u003e\n\n# How it works\n###### This is simply a function that approximates color to your palette by blending your color with similar colors. No magic.\n\u003cimg width=\"624\" alt=\"Frame 2\" src=\"https://github.com/LIMPIX31/themd/assets/81296950/175b0e59-b4a8-4793-b35e-7ac3bfb8a7f0\"\u003e\n\n# How to use\n###### Firstly, define your color guides. The more, the better\n```ts\nconst guides = [\n  // colors\n  '#dc322f', // red\n  '#cb4b16', // orange\n  '#b58900', // yellow\n  '#859900', // green\n  '#2aa198', // aqua\n  '#268bd2', // blue\n  '#6c71c4', // magenta\n  '#d33682', // purple\n\n  // grayscales\n  '#002b36',\n  '#073642',\n  '#586e75',\n  '#657b83',\n  '#839496',\n  '#93a1a1',\n  '#eee8d5',\n  '#fdf6e3',\n]\n```\n###### Let's derive a new color based on the guides\n```ts\nimport { derive } from 'themd'\n\nconst target = '#00FF57' // toxic green\n\nconst getColor = derive(guides)\nconst result = getColor(target)\n\nconsole.log(result)\n```\n###### You can configure it\n```ts\nconst getColor = derive(guides, {\n  ratio: 0.75, // Limit on the ratio and number of colors to be mixed (default: 0.75)\n  dry: 0.5, // Mixing ratio with input color\n  clamp: false, // The output color can't be lighter or darker than the color guides (default: false),\n  // Selects the most matching color from the color guides, \n  // without mixing the color. Discards all the options above.\n  strict: false\n})\n```\n* **Dry: 1** - means that the output color consists only of color guides\n* **Ratio: \u003e2**  - The more `ratio`, the more colors will be mixed, it is recommended to change between 0.25 and 1.75\n* **Clamped: true** - means that even with the input color `#000` you won't get a color darker than what is in the color guides. Similarly, with light colors.\n\n# Troubleshooting\n* Sometimes the input color can fall into the group of background colors (too dark or light). This is considered normal because the colors are often more similar in brightness than in hue. You have two ways to solve this problem: add a similar color to the color guides or adjust the `ratio` parameter in more detail.\n\n# Specific use\nYou can convert colors to grayscale. Note that this may be unstable.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flimpix31%2Fthemd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flimpix31%2Fthemd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flimpix31%2Fthemd/lists"}