{"id":15616739,"url":"https://github.com/justjavac/deno_x256","last_synced_at":"2026-04-29T17:39:47.045Z","repository":{"id":57675370,"uuid":"286655844","full_name":"justjavac/deno_x256","owner":"justjavac","description":"Find the nearest xterm 256 color index for an rgb","archived":false,"fork":false,"pushed_at":"2020-09-05T15:51:36.000Z","size":11,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-05T09:17:15.304Z","etag":null,"topics":["color","colors","deno","deno-mod","deno-module","x256","xterm","xterm-256color","xterm256"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/justjavac.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2020-08-11T05:41:04.000Z","updated_at":"2020-09-05T15:51:35.000Z","dependencies_parsed_at":"2022-09-26T16:40:20.536Z","dependency_job_id":null,"html_url":"https://github.com/justjavac/deno_x256","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":"justjavac/deno_starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justjavac%2Fdeno_x256","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justjavac%2Fdeno_x256/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justjavac%2Fdeno_x256/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justjavac%2Fdeno_x256/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/justjavac","download_url":"https://codeload.github.com/justjavac/deno_x256/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246201158,"owners_count":20739708,"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":["color","colors","deno","deno-mod","deno-module","x256","xterm","xterm-256color","xterm256"],"created_at":"2024-10-03T07:21:43.282Z","updated_at":"2026-04-29T17:39:47.017Z","avatar_url":"https://github.com/justjavac.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# deno_x256\n\n[![tag](https://img.shields.io/github/release/justjavac/deno_x256)](https://github.com/justjavac/deno_x256/releases)\n[![Build Status](https://github.com/justjavac/deno_x256/workflows/ci/badge.svg?branch=master)](https://github.com/justjavac/deno_x256/actions)\n[![license](https://img.shields.io/github/license/justjavac/deno_x256)](https://github.com/justjavac/deno_x256/blob/master/LICENSE)\n\nFind the nearest [xterm 256 color](http://www.frexx.de/xterm-256-notes/) index for an rgb.\n\ncolors data source https://cdn.jsdelivr.net/gh/substack/node-x256@master/colors.json\n\n## Usage\n\nAll xterm 256 colors:\n\n```ts\nimport color from \"https://deno.land/x/x256/color.ts\";\n\nconsole.log(color)\n```\n\noutput:\n\n```ts\n[\n  \"000000\",\n  \"800000\",\n  \"008000\",\n  \"808000\",\n  \"000080\",\n  \"800080\",\n  ...\n  ...\n```\n\nGet the nearest xterm 256 color code for rgb inputs.:\n\n```ts\nimport x256 from \"https://deno.land/x/x256/mod.ts\";\n\nconst c = x256(220,40,150);\nconsole.log(c); // 162\n```\n\nUse raw ansi escape codes:\n\nCheck if the language code is valid:\n\n```ts\nimport x256 from \"https://deno.land/x/x256/mod.ts\";\n\nconst c = x256(220,40,150);\nconsole.log(`\\x1b[38;5;${c}mBEEEEEP`);\n```\n\n### License\n\n[deno_x256](https://github.com/justjavac/deno_x256) is released under the MIT License. See the bundled [LICENSE](./LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustjavac%2Fdeno_x256","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjustjavac%2Fdeno_x256","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustjavac%2Fdeno_x256/lists"}