{"id":30046715,"url":"https://github.com/teneplaysofficial/kolory","last_synced_at":"2026-01-20T16:59:32.935Z","repository":{"id":308328711,"uuid":"1028382028","full_name":"teneplaysofficial/kolory","owner":"teneplaysofficial","description":"Paint your projects with vibrant Kolory","archived":false,"fork":false,"pushed_at":"2025-08-05T09:50:05.000Z","size":64,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-05T11:37:21.533Z","etag":null,"topics":["color-conversion","color-utils","colors","frontend-tools","hex-rgb-hsl","javascript","library","npm-package","palette-generator","web-design"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/teneplaysofficial.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/funding.yml","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,"zenodo":null},"funding":{"github":"TenEplaysOfficial"}},"created_at":"2025-07-29T12:55:29.000Z","updated_at":"2025-08-05T09:50:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"f0624e9c-2f2f-4773-b58a-5ebd99679ca8","html_url":"https://github.com/teneplaysofficial/kolory","commit_stats":null,"previous_names":["teneplaysofficial/kolory"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/teneplaysofficial/kolory","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teneplaysofficial%2Fkolory","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teneplaysofficial%2Fkolory/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teneplaysofficial%2Fkolory/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teneplaysofficial%2Fkolory/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/teneplaysofficial","download_url":"https://codeload.github.com/teneplaysofficial/kolory/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teneplaysofficial%2Fkolory/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269227881,"owners_count":24381837,"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","status":"online","status_checked_at":"2025-08-07T02:00:09.698Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-conversion","color-utils","colors","frontend-tools","hex-rgb-hsl","javascript","library","npm-package","palette-generator","web-design"],"created_at":"2025-08-07T08:53:31.599Z","updated_at":"2026-01-20T16:59:32.930Z","avatar_url":"https://github.com/teneplaysofficial.png","language":"TypeScript","funding_links":["https://github.com/sponsors/TenEplaysOfficial"],"categories":[],"sub_categories":[],"readme":"\u003e [!WARNING]  \n\u003e This repository has been **moved**. Please use the new location instead: 👉 [https://github.com/teneplaysofficial/omnijs](https://github.com/teneplaysofficial/omnijs)\n\n\u003cdiv align=\"center\"\u003e\n\n# Kolory\n\n_Paint your projects with vibrant Kolory_\n\n[![build](https://github.com/teneplaysofficial/kolory/actions/workflows/release.yml/badge.svg)](https://github.com/teneplaysofficial/kolory/actions/workflows/release.yml)\n[![license](https://img.shields.io/npm/l/kolory)](./LICENSE)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/teneplaysofficial/kolory)\n[![eslint](https://img.shields.io/badge/lint-eslint-4B32C3)](https://github.com/teneplaysofficial/kolory)\n\n\u003c/div\u003e\n\n## Overview\n\n**Kolory** is a lightweight, versatile, and zero-dependency JavaScript library designed for seamless color manipulation and exploration. It supports multiple color formats (`HEX`, `RGB`, `RGBA`, `HSL`, `HSLA`) and provides built-in ANSI escape code support for styling terminal output. With a simple and intuitive API, Kolory empowers developers to work with colors effortlessly in both Node.js and browser environments.\n\nWhether you're converting colors, generating dynamic palettes, or enhancing CLI output with vibrant formatting, Kolory is your go-to tool for all things color.\n\n## Features\n\n- **Multiple Color Formats**: Work with `HEX`, `RGB`, `RGBA`, `HSL`, and `HSLA` formats effortlessly.\n- **Prebuilt Distributions**: Available in ESM, CommonJS, and IIFE formats for maximum compatibility.\n- **Zero Dependencies**: Lightweight with a minimal footprint for optimal performance.\n- **TypeScript Support**: First-class TypeScript definitions for a type-safe development experience.\n- **Cross-Platform**: Compatible with Node.js, Deno, and modern browsers.\n- **ANSI Styling**: Built-in support for 4-bit, 8-bit, and 24-bit ANSI escape codes to style CLI output.\n\n## Installation\n\nKolory can be installed via all major package managers or used directly in the browser via a CDN.\n\n### Using Package Managers\n\n```bash\n# npm\nnpm install kolory\n\n# yarn\nyarn add kolory\n\n# pnpm\npnpm add kolory\n\n# bun\nbun add kolory\n```\n\n### Using CDN (Browser)\n\nInclude Kolory in your HTML for browser-based projects:\n\n```html\n\u003c!-- UNPKG --\u003e\n\u003cscript src=\"https://unpkg.com/kolory/dist/index.iife.js\"\u003e\u003c/script\u003e\n\n\u003c!-- jsDelivr --\u003e\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/kolory/dist/index.iife.js\"\u003e\u003c/script\u003e\n\n\u003c!-- ESM (Modern Browsers) --\u003e\n\u003cscript type=\"module\"\u003e\n  import kolory from 'https://esm.sh/kolory';\n\u003c/script\u003e\n```\n\n## Usage\n\nKolory provides a straightforward API to access and manipulate colors in various formats. Below are examples for different environments.\n\n### ESM (Modern JavaScript)\n\n```js\nimport kolory, { hex, rgb, rgba, hsl, hsla } from 'kolory';\n\nconsole.log(kolory.hex.blue_metal);\nconsole.log(hex.blue_metal);\nconsole.log(rgb.blue_metal);\n```\n\n### CommonJS\n\n```js\nconst { hex, rgb } = require('kolory');\n\nconsole.log(hex.sunset_orange);\nconsole.log(rgb.sunset_orange);\n```\n\n### Browser (IIFE via CDN)\n\n```html\n\u003cscript src=\"https://unpkg.com/kolory/dist/index.iife.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n  console.log(kolory.hex.blue_metal);\n\u003c/script\u003e\n```\n\n## Color Data Structure\n\nKolory organizes colors in a structured JSON format, with each color entry providing values for all supported formats. Below is an example:\n\n```json\n{\n  \"blue_metal\": {\n    \"hex\": \"#4A90E2\",\n    \"rgb\": \"74,144,226\",\n    \"rgba\": \"74,144,226,1\",\n    \"hsl\": \"210,73%,58%\",\n    \"hsla\": \"210,73%,58%,1\"\n  }\n}\n```\n\n## API Reference\n\nKolory exports several modules to access colors in different formats:\n\n| Export   | Description                                    |\n| -------- | ---------------------------------------------- |\n| `kolory` | Structured object containing all color formats |\n| `hex`    | Colors in HEX format (e.g., `#4A90E2`)         |\n| `rgb`    | Colors in RGB format (e.g., `74,144,226`)      |\n| `rgba`   | Colors in RGBA format (e.g., `74,144,226,1`)   |\n| `hsl`    | Colors in HSL format (e.g., `210,73%,58%`)     |\n| `hsla`   | Colors in HSLA format (e.g., `210,73%,58%,1`)  |\n| `ansi`   | ANSI escape codes for CLI styling              |\n\n## ANSI Escape Codes\n\nKolory includes robust support for ANSI escape codes, enabling vibrant and expressive CLI output. It supports 4-bit, 8-bit, and 24-bit color modes, with a chainable syntax for easy styling.\n\n### ANSI Features\n\n- **Chainable Syntax**: Combine styles fluently (e.g., `ansi.red.bold.underline('Hello')`).\n- **Fully Typed**: TypeScript support for all ANSI styles.\n- **Comprehensive SGR Codes**: Includes all Select Graphic Rendition (SGR) codes.\n- **Cross-Platform**: Works in Node.js, Deno, and ANSI-compatible browser terminals.\n- **Auto-Reset**: Automatically appends `\\x1b[0m` to reset styles after each print.\n- **Raw Output**: Use `.apply(text)` to retrieve styled strings without printing.\n\n### ANSI Usage\n\n```js\nimport { ansi } from 'kolory';\n\n// Basic styling\nansi.bold('Bold text'); // Bold text\nansi.italic.underline('Stylish!'); // Italicized and underlined text\nansi.red.bgWhite.bold('Alert!'); // Red text on white background, bold\nconsole.log(ansi.green.apply('Green text')); // Returns raw styled string\n```\n\n### Supported ANSI Styles\n\n| Category        | Styles                                                                                                                         |\n| --------------- | ------------------------------------------------------------------------------------------------------------------------------ |\n| **Text Styles** | `bold`, `dim`, `italic`, `underline`, `blink`, `inverse`, `hidden`                                                             |\n| **Foreground**  | `black`, `red`, `green`, `yellow`, `blue`, `magenta`, `cyan`, `white`                                                          |\n| **Bright FG**   | `gray`, `brightRed`, `brightGreen`, `brightYellow`, `brightBlue`, `brightMagenta`, `brightCyan`, `brightWhite`                 |\n| **Background**  | `bgBlack`, `bgRed`, `bgGreen`, `bgYellow`, `bgBlue`, `bgMagenta`, `bgCyan`, `bgWhite`                                          |\n| **Bright BG**   | `bgGray`, `bgBrightRed`, `bgBrightGreen`, `bgBrightYellow`, `bgBrightBlue`, `bgBrightMagenta`, `bgBrightCyan`, `bgBrightWhite` |\n| **Reset**       | `.reset` (or automatic after every print)                                                                                      |\n\n### ANSI Examples\n\n```js\nansi.inverse('Inverted'); // Inverted text\nansi.brightCyan('Bright Cyan Text'); // Bright cyan text\nansi.bgBrightMagenta.white.bold('Highlight this!'); // White bold text on bright magenta background\n```\n\n### How ANSI Works\n\nKolory’s ANSI support uses dynamic proxy chaining to build escape sequences. Each chained property appends an ANSI code, and the final invocation wraps the text with the appropriate codes:\n\n```js\nansi.red.bold('Hello'); // Outputs: \\u001b[31m\\u001b[1mHello\\u001b[0m\n```\n\n\u003e [!NOTE]\n\u003e Use `.apply(text)` to retrieve the raw styled string for further processing without printing to the console.\n\n## Contributing\n\nWe welcome contributions to make Kolory even better! To contribute:\n\n1. **Add Colors**: Add new color entries to [kolory.json](./kolory.json), following the structure defined in [kolory.schema.json](./kolory.schema.json).\n2. **Supported Formats**: Ensure each color includes `hex`, `rgb`, `rgba`, `hsl`, and `hsla` values.\n3. **Consistency**: Maintain consistent naming and formatting across all entries.\n4. **Code Quality**: Run the formatter (`prettier`) and linter (`eslint`) before submitting a pull request.\n5. **Submit a PR**: Open a pull request with a clear description of your changes.\n\n## License\n\nKolory is licensed under the [Apache License 2.0](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteneplaysofficial%2Fkolory","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fteneplaysofficial%2Fkolory","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteneplaysofficial%2Fkolory/lists"}