{"_id":"@ahmedsemih/color-fns","_rev":"4-fc06cb80dcf64269f631a346dfe1c82d","name":"@ahmedsemih/color-fns","dist-tags":{"latest":"1.3.0"},"versions":{"1.0.0":{"name":"@ahmedsemih/color-fns","version":"1.0.0","keywords":["color","colors","color-toolkit","color-tools","color-utils","color-functions","color-fns","color-conversion","color-manipulation","color-library","rgb","hex","hsl","rgba","utility","utilities","css-colors","convert-color","tree-shakable","lightweight","dependency-free","javascript","typescript"],"author":{"url":"https://github.com/ahmedsemih","name":"Ahmed Semih Erkan"},"license":"MIT","_id":"@ahmedsemih/color-fns@1.0.0","maintainers":[{"name":"ahmedsemih","email":"ahmedsemiherkan@gmail.com"}],"homepage":"https://github.com/ahmedsemih/color-fns#readme","bugs":{"url":"https://github.com/ahmedsemih/color-fns/issues"},"dist":{"shasum":"7226ce32571835ee1845b6d0dd5979f3b361d5ab","tarball":"https://registry.npmjs.org/@ahmedsemih/color-fns/-/color-fns-1.0.0.tgz","fileCount":174,"integrity":"sha512-6KpOdmPEhmCcbXQYzNEJ6paHrOueujkIW6MwcgF7Kb11/vxBbKaWy44ixEIw76nV4UMK1Sy+kTogfyoJEwxSOA==","signatures":[{"sig":"MEQCIC2MOqD5YIoxzkY/R8UpOwpBMC+nkI+DNOBhrXtMIP04AiBf9O7YyJtKqkBNcch0kkqgZoj/xOBqm+1nmmCWuPA7Hg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":113063},"main":"dist/cjs/index.cjs","type":"module","types":"dist/index.d.ts","module":"dist/esm/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/index.d.ts","default":"./dist/cjs/index.cjs"}}},"gitHead":"ca90e6f8c5bce25768db06a2ae4a2fb48c53fea2","scripts":{"lint":"eslint","test":"vitest","build":"npm run clean && npm run build:types && npm run build:js","clean":"rm -rf dist","format":"prettier --write '**/*.{ts,js,md,yml}'","build:js":"npm run build:esm && npm run build:cjs","build:cjs":"rollup -c --environment BUILD:cjs","build:esm":"rollup -c --environment BUILD:esm","test:watch":"vitest --watch","build:types":"tsc","prepublishOnly":"npm run test && npm run build"},"_npmUser":{"name":"ahmedsemih","email":"ahmedsemiherkan@gmail.com"},"repository":{"url":"git+https://github.com/ahmedsemih/color-fns.git","type":"git"},"_npmVersion":"11.2.0","description":"A modern, lightweight, and tree-shakable utility library for working with colors in JavaScript and TypeScript. Easily convert between color formats like RGB, HEX, and HSL, generate random colors, and manipulate colors.","directories":{},"sideEffects":false,"_nodeVersion":"20.18.1","_hasShrinkwrap":false,"devDependencies":{"tslib":"^2.8.1","eslint":"^9.30.0","rollup":"^4.44.1","vitest":"^3.2.4","prettier":"^3.6.2","typescript":"^5.8.3","@types/node":"^24.0.7","rollup-plugin-dts":"^6.2.1","@vitest/coverage-v8":"^3.2.4","@rollup/plugin-terser":"^0.4.4","eslint-config-prettier":"^10.1.5","eslint-plugin-prettier":"^5.5.1","@rollup/plugin-typescript":"^12.1.4","@typescript-eslint/parser":"^8.35.0","@typescript-eslint/eslint-plugin":"^8.35.0"},"_npmOperationalInternal":{"tmp":"tmp/color-fns_1.0.0_1752667162389_0.5882462279218659","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@ahmedsemih/color-fns","version":"1.1.0","keywords":["color","colors","color-toolkit","color-tools","color-utils","color-functions","color-fns","color-conversion","color-manipulation","color-library","rgb","hex","hsl","rgba","utility","utilities","css-colors","generate-color","convert-color","tree-shakable","lightweight","dependency-free","javascript","typescript"],"author":{"url":"https://github.com/ahmedsemih","name":"Ahmed Semih Erkan"},"license":"MIT","_id":"@ahmedsemih/color-fns@1.1.0","maintainers":[{"name":"ahmedsemih","email":"ahmedsemiherkan@gmail.com"}],"homepage":"https://github.com/ahmedsemih/color-fns#readme","bugs":{"url":"https://github.com/ahmedsemih/color-fns/issues"},"dist":{"shasum":"45fa0824987be28c93c59df96179a32332428bf8","tarball":"https://registry.npmjs.org/@ahmedsemih/color-fns/-/color-fns-1.1.0.tgz","fileCount":212,"integrity":"sha512-U5QvwbEikNktehmr53yUUs9pxBYfoMMI0a0nsc0lUdZqGqWeD1UZOiiS8WnWeezSXoa1Ozb/VdtVzYpKqekCKA==","signatures":[{"sig":"MEQCIDfU3IM37wnZ/Phw61shZNBb0iTBwL0bnkrNbANvJaGsAiBHdvWbW0BpprBde/tGQdp1fdl3CIUN2fK6KYJBRdIeAA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":127440},"main":"dist/cjs/index.cjs","type":"module","types":"dist/index.d.ts","module":"dist/esm/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/index.d.ts","default":"./dist/cjs/index.cjs"}}},"gitHead":"776e31128fd43ae84ae9ff22485035f7f5bb8083","scripts":{"lint":"eslint","test":"vitest","build":"npm run clean && npm run build:types && npm run build:js","clean":"rm -rf dist","format":"prettier --write '**/*.{ts,js,md,yml}'","build:js":"npm run build:esm && npm run build:cjs","build:cjs":"rollup -c --environment BUILD:cjs","build:esm":"rollup -c --environment BUILD:esm","test:watch":"vitest --watch","build:types":"tsc","prepublishOnly":"npm run test && npm run build"},"_npmUser":{"name":"ahmedsemih","email":"ahmedsemiherkan@gmail.com"},"repository":{"url":"git+https://github.com/ahmedsemih/color-fns.git","type":"git"},"_npmVersion":"11.2.0","description":"A modern, lightweight, and tree-shakable utility library for working with colors.","directories":{},"sideEffects":false,"_nodeVersion":"20.18.1","_hasShrinkwrap":false,"devDependencies":{"tslib":"^2.8.1","eslint":"^9.30.0","rollup":"^4.44.1","vitest":"^3.2.4","prettier":"^3.6.2","typescript":"^5.8.3","@types/node":"^24.0.7","rollup-plugin-dts":"^6.2.1","@vitest/coverage-v8":"^3.2.4","@rollup/plugin-terser":"^0.4.4","eslint-config-prettier":"^10.1.5","eslint-plugin-prettier":"^5.5.1","@rollup/plugin-typescript":"^12.1.4","@typescript-eslint/parser":"^8.35.0","@typescript-eslint/eslint-plugin":"^8.35.0"},"_npmOperationalInternal":{"tmp":"tmp/color-fns_1.1.0_1752944623744_0.500643838485298","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@ahmedsemih/color-fns","version":"1.2.0","keywords":["color","colors","color-toolkit","color-tools","color-utils","color-functions","color-fns","color-conversion","color-manipulation","color-library","rgb","hex","hsl","rgba","utility","utilities","css-colors","generate-color","convert-color","tree-shakable","lightweight","dependency-free","javascript","typescript"],"author":{"url":"https://github.com/ahmedsemih","name":"Ahmed Semih Erkan"},"license":"MIT","_id":"@ahmedsemih/color-fns@1.2.0","maintainers":[{"name":"ahmedsemih","email":"ahmedsemiherkan@gmail.com"}],"homepage":"https://github.com/ahmedsemih/color-fns#readme","bugs":{"url":"https://github.com/ahmedsemih/color-fns/issues"},"dist":{"shasum":"460e1b1610a62d993d8484602104d7a6ab1a746c","tarball":"https://registry.npmjs.org/@ahmedsemih/color-fns/-/color-fns-1.2.0.tgz","fileCount":230,"integrity":"sha512-yTA4UvSFJcI3YX7OpG/vza6Ox/O9dsXy4qtrepQ22rac+/YOiXWTZNude5joRua9e0yKBF9/RyJ/AktiePglwg==","signatures":[{"sig":"MEYCIQD0G45LpVPmXsTzA/aDGnxnDWm67waTJvkAfPWC7qJcuAIhANy5SU65OjzyrxyYxwjI/XYBxTdwnn5r53oufYZYtnaX","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":143811},"main":"dist/cjs/index.cjs","type":"module","types":"dist/index.d.ts","module":"dist/esm/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/index.d.ts","default":"./dist/cjs/index.cjs"}}},"gitHead":"7991239b18181c07d29ce311e399aea13b52f20c","scripts":{"lint":"eslint","test":"vitest","build":"npm run clean && npm run build:types && npm run build:js","clean":"rm -rf dist","format":"prettier --write '**/*.{ts,js,md,yml}'","build:js":"npm run build:esm && npm run build:cjs","build:cjs":"rollup -c --environment BUILD:cjs","build:esm":"rollup -c --environment BUILD:esm","test:watch":"vitest --watch","build:types":"tsc","prepublishOnly":"npm run test && npm run build"},"_npmUser":{"name":"ahmedsemih","email":"ahmedsemiherkan@gmail.com"},"repository":{"url":"git+https://github.com/ahmedsemih/color-fns.git","type":"git"},"_npmVersion":"11.2.0","description":"A modern, lightweight, and tree-shakable utility library for working with colors.","directories":{},"sideEffects":false,"_nodeVersion":"20.18.1","_hasShrinkwrap":false,"devDependencies":{"tslib":"^2.8.1","eslint":"^9.30.0","rollup":"^4.44.1","vitest":"^3.2.4","prettier":"^3.6.2","typescript":"^5.8.3","@types/node":"^24.0.7","rollup-plugin-dts":"^6.2.1","@vitest/coverage-v8":"^3.2.4","@rollup/plugin-terser":"^0.4.4","eslint-config-prettier":"^10.1.5","eslint-plugin-prettier":"^5.5.1","@rollup/plugin-typescript":"^12.1.4","@typescript-eslint/parser":"^8.35.0","@typescript-eslint/eslint-plugin":"^8.35.0"},"_npmOperationalInternal":{"tmp":"tmp/color-fns_1.2.0_1753115556083_0.7241455785772377","host":"s3://npm-registry-packages-npm-production"}},"1.3.0":{"name":"@ahmedsemih/color-fns","version":"1.3.0","description":"A modern, lightweight, and tree-shakable utility library for working with colors.","keywords":["color","conversion","generation","manipulation","validation","parser","utility","functions","rgb","hex","hsl","css","tree-shakable","lightweight","dependency-free","javascript","typescript"],"license":"MIT","author":{"name":"Ahmed Semih Erkan","url":"https://github.com/ahmedsemih"},"homepage":"https://github.com/ahmedsemih/color-fns#readme","repository":{"type":"git","url":"git+https://github.com/ahmedsemih/color-fns.git"},"bugs":{"url":"https://github.com/ahmedsemih/color-fns/issues"},"type":"module","main":"dist/cjs/index.cjs","module":"dist/esm/index.js","types":"dist/index.d.ts","sideEffects":false,"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/index.d.ts","default":"./dist/cjs/index.cjs"}}},"scripts":{"clean":"rm -rf dist","build:types":"tsc","build:esm":"rollup -c --environment BUILD:esm","build:cjs":"rollup -c --environment BUILD:cjs","build:js":"npm run build:esm && npm run build:cjs","build":"npm run clean && npm run build:types && npm run build:js","test":"vitest","test:watch":"vitest --watch","lint":"eslint","format":"prettier --write '**/*.{ts,js,md,yml}'","prepublishOnly":"npm run test && npm run build"},"devDependencies":{"@rollup/plugin-terser":"^0.4.4","@rollup/plugin-typescript":"^12.1.4","@types/node":"^24.0.7","@typescript-eslint/eslint-plugin":"^8.35.0","@typescript-eslint/parser":"^8.35.0","@vitest/coverage-v8":"^3.2.4","eslint":"^9.30.0","eslint-config-prettier":"^10.1.5","eslint-plugin-prettier":"^5.5.1","prettier":"^3.6.2","rollup":"^4.44.1","rollup-plugin-dts":"^6.2.1","tslib":"^2.8.1","typescript":"^5.8.3","vitest":"^3.2.4"},"_id":"@ahmedsemih/color-fns@1.3.0","gitHead":"2afba4273a2c9ee7f81c491a3df5163f9e8b21e3","_nodeVersion":"20.18.1","_npmVersion":"11.2.0","dist":{"integrity":"sha512-KjPMB+bUqOrJRvCCHVtbpHaCy621xD/Pn2LlJyAZx2lVwuc8d1FzDXSDIzM4iTNu/xUWoT/yfKQAuB2vFmeBnQ==","shasum":"de6f30a717cbb0c1d06bf45af285e11e4dc2b762","tarball":"https://registry.npmjs.org/@ahmedsemih/color-fns/-/color-fns-1.3.0.tgz","fileCount":272,"unpackedSize":168815,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQChCSMzDHKKhKPD0/8Y/A6jqIvqSUvThmdJ1TUo8XI9KQIhAKVn6XrQpAyAOiBHE4+fHNFxvu6YL+iPRgP66LjsKoMD"}]},"_npmUser":{"name":"ahmedsemih","email":"ahmedsemiherkan@gmail.com"},"directories":{},"maintainers":[{"name":"ahmedsemih","email":"ahmedsemiherkan@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/color-fns_1.3.0_1753516410310_0.8532680261963419"},"_hasShrinkwrap":false}},"time":{"created":"2025-07-16T11:59:22.276Z","modified":"2025-07-26T07:53:30.759Z","1.0.0":"2025-07-16T11:59:22.560Z","1.1.0":"2025-07-19T17:03:43.965Z","1.2.0":"2025-07-21T16:32:36.260Z","1.3.0":"2025-07-26T07:53:30.527Z"},"bugs":{"url":"https://github.com/ahmedsemih/color-fns/issues"},"author":{"name":"Ahmed Semih Erkan","url":"https://github.com/ahmedsemih"},"license":"MIT","homepage":"https://github.com/ahmedsemih/color-fns#readme","keywords":["color","conversion","generation","manipulation","validation","parser","utility","functions","rgb","hex","hsl","css","tree-shakable","lightweight","dependency-free","javascript","typescript"],"repository":{"type":"git","url":"git+https://github.com/ahmedsemih/color-fns.git"},"description":"A modern, lightweight, and tree-shakable utility library for working with colors.","maintainers":[{"name":"ahmedsemih","email":"ahmedsemiherkan@gmail.com"}],"readme":"<div align=\"center\">\r\n\r\n# color-fns\r\n\r\n![Npm Version](https://img.shields.io/npm/v/@ahmedsemih/color-fns.svg)\r\n![Bundle Size](https://img.shields.io/bundlephobia/min/@ahmedsemih/color-fns)\r\n![Types Included](https://img.shields.io/npm/types/@ahmedsemih/color-fns)\r\n![Downloads](https://img.shields.io/npm/dt/@ahmedsemih/color-fns)\r\n![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)\r\n![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)\r\n\r\n**Modern, lightweight, and zero-dependency JavaScript & TypeScript color utility library. Effortlessly convert, validate, manipulate, parse and generate colors in popular formats like RGB, HEX, and HSL. Tree-shakable and optimized for minimal bundle size perfect for web and Node.js projects.**\r\n\r\n</div>\r\n\r\n## ⚡ Features\r\n\r\n- 🎨 **Convert** between HEX, RGB & HSL easily\r\n- ✨ **Supports** modern CSS color formats & units (`deg`, `rad`, `turn`, `grad`)\r\n- 🔒 **Type-safe** with full TypeScript support\r\n- 🧩 **Zero dependencies**, tiny & fast\r\n- 🌳 **Tree-shakable**, import only what you use\r\n- ✅ **Validate** colors with simple checks\r\n- 🎲 **Generate** random colors in RGB, HSL, or HEX\r\n- 🛠️ **Manipulate** colors effortlessly\r\n- 🎯 **Consistent API**, easy to learn & use\r\n\r\n## 🛠️ Installation\r\n\r\n```bash\r\n# Using npm\r\nnpm install @ahmedsemih/color-fns\r\n\r\n# Using yarn\r\nyarn add @ahmedsemih/color-fns\r\n\r\n# Using pnpm\r\npnpm add @ahmedsemih/color-fns\r\n```\r\n\r\n## 🚀 Usage\r\n\r\n```js\r\n// ESM\r\nimport { toRgb } from '@ahmedsemih/color-fns';\r\n\r\n// CommonJS\r\nconst { toRgb } = require('@ahmedsemih/color-fns');\r\n\r\nconst rgb = toRgb('#ff8000');\r\n```\r\n\r\n## 📑 Table of Contents\r\n\r\n#### Convert\r\n\r\n- [toRgb](#toRgb)\r\n- [toRgbString](#toRgbString)\r\n- [toHsl](#toHsl)\r\n- [toHslString](#toHslString)\r\n- [toHex](#toHex)\r\n- [toCss](#toCss)\r\n- [rgbToHsl](#rgbToHsl)\r\n- [rgbToHex](#rgbToHex)\r\n- [hslToRgb](#hslToRgb)\r\n- [hslToHex](#hslToHex)\r\n- [hexToRgb](#hexToRgb)\r\n- [hexToHsl](#hexToHsl)\r\n\r\n#### Validate\r\n\r\n- [isRgb](#isRgb)\r\n- [isHsl](#isHsl)\r\n- [isHex](#isHex)\r\n- [isValid](#isValid)\r\n\r\n#### Generate\r\n\r\n- [randomRgb](#randomRgb)\r\n- [randomHsl](#randomHsl)\r\n- [randomHex](#randomHex)\r\n- [generateShades](#generateShades)\r\n- [generateTints](#generateTints)\r\n- [generateTones](#generateTones)\r\n\r\n### Manipulate\r\n\r\n- [mix](#mix)\r\n- [lighten](#lighten)\r\n- [darken](#darken)\r\n- [saturate](#saturate)\r\n- [desaturate](#desaturate)\r\n- [grayscale](#grayscale)\r\n- [invert](#invert)\r\n- [setAlpha](#setAlpha)\r\n\r\n#### Parse\r\n\r\n- [parseRgb](#parseRgb)\r\n- [parseHsl](#parseHsl)\r\n- [parseHex](#parseHex)\r\n- [parseAlpha](#parseAlpha)\r\n- [parseHue](#parseHue)\r\n- [parseChannel](#parseChannel)\r\n\r\n#### Types\r\n\r\n- [RgbColor](#RgbColor)\r\n- [HslColor](#HslColor)\r\n- [Color](#Color)\r\n\r\n## 📚 API Reference\r\n\r\n### 🔄 Convert\r\n\r\nConverts colors between different formats (RGB, HSL, HEX).\r\n\r\n#### <a id=\"toRgb\"></a>`toRgb(color: string | RgbColor | HslColor): RgbColor`\r\n\r\nConverts a color to an RGB object.\r\n\r\n```js\r\nimport { toRgb } from '@ahmedsemih/color-fns';\r\n\r\ntoRgb('#ff8000');\r\n// { red: 255, green: 128, blue: 0 }\r\ntoRgb('#ff8000cc');\r\n// { red: 255, green: 128, blue: 0, alpha: 0.8 }\r\ntoRgb('hsl(30, 100%, 50%)');\r\n// { red: 255, green: 128, blue: 0 }\r\ntoRgb({ hue: 30, saturation: 100, lightness: 50 });\r\n// { red: 255, green: 128, blue: 0 }\r\ntoRgb({ hue: 30, saturation: 100, lightness: 50, alpha: 0.5 });\r\n// { red: 255, green: 128, blue: 0, alpha: 0.5 }\r\n```\r\n\r\n#### <a id=\"toRgbString\"></a>`toRgbString(color: string | RgbColor | HslColor): string`\r\n\r\nConverts a color to CSS-compatible RGB string.\r\n\r\n```js\r\nimport { toRgbString } from '@ahmedsemih/color-fns';\r\n\r\ntoRgbString('#ff8000');\r\n// 'rgb(255, 128, 0)'\r\ntoRgbString('#ff8000cc');\r\n// 'rgba(255, 128, 0, 0.8)'\r\ntoRgbString('hsl(30, 100%, 50%)');\r\n// 'rgb(255, 128, 0)'\r\ntoRgbString({ hue: 30, saturation: 100, lightness: 50 });\r\n// 'rgb(255, 128, 0)'\r\ntoRgbString({ hue: 30, saturation: 100, lightness: 50, alpha: 0.5 });\r\n// 'rgba(255, 128, 0, 0.5)'\r\n```\r\n\r\n#### <a id=\"toHsl\"></a>`toHsl(color: string | RgbColor | HslColor): HslColor`\r\n\r\nConverts a color to an HSL object.\r\n\r\n```js\r\nimport { toHsl } from '@ahmedsemih/color-fns';\r\n\r\ntoHsl('#ff8000');\r\n// { hue: 30, saturation: 100, lightness: 50 }\r\ntoHsl('#ff8000cc');\r\n// { hue: 30, saturation: 100, lightness: 50, alpha: 0.8 }\r\ntoHsl('rgb(255, 128, 0)');\r\n// { hue: 30, saturation: 100, lightness: 50 }\r\ntoHsl({ red: 255, green: 128, blue: 0 });\r\n// { hue: 30, saturation: 100, lightness: 50 }\r\ntoHsl({ red: 255, green: 128, blue: 0, alpha: 0.5 });\r\n// { hue: 30, saturation: 100, lightness: 50, alpha: 0.5 }\r\n```\r\n\r\n#### <a id=\"toHslString\"></a>`toHslString(color: string | RgbColor | HslColor): string`\r\n\r\nConverts a color to CSS-compatible HSL string.\r\n\r\n```js\r\nimport { toHslString } from '@ahmedsemih/color-fns';\r\n\r\ntoHslString('#ff8000');\r\n// 'hsl(30, 100%, 50%)'\r\ntoHslString('#ff8000cc');\r\n// 'hsla(30, 100%, 50%, 0.8)'\r\ntoHslString('rgb(255, 128, 0)');\r\n// 'hsl(30, 100%, 50%)'\r\ntoHslString({ red: 255, green: 128, blue: 0 });\r\n// 'hsl(30, 100%, 50%)'\r\ntoHslString({ red: 255, green: 128, blue: 0, alpha: 0.5 });\r\n// 'hsla(30, 100%, 50%, 0.5)'\r\n```\r\n\r\n#### <a id=\"toHex\"></a>`toHex(color: string | RgbColor | HslColor): string`\r\n\r\nConverts a color to CSS-compatible HEX string.\r\n\r\n```js\r\nimport { toHex } from '@ahmedsemih/color-fns';\r\n\r\ntoHex('rgb(255, 128, 0)');\r\n// '#ff8000'\r\ntoHex({ red: 255, green: 128, blue: 0 });\r\n// '#ff8000'\r\ntoHex({ red: 255, green: 128, blue: 0, alpha: 0.5 });\r\n// '#ff8000cc'\r\ntoHex('hsl(30, 100%, 50%)');\r\n// '#ff8000'\r\ntoHex({ hue: 30, saturation: 100, lightness: 50 });\r\n// '#ff8000'\r\ntoHex({ hue: 30, saturation: 100, lightness: 50, alpha: 0.5 });\r\n// '#ff8000cc'\r\n```\r\n\r\n#### <a id=\"toCss\"></a>`toCss(color: RgbColor | HslColor): string`\r\n\r\nConverts a color to a CSS-compatible string (RGB, HSL, or HEX).\r\n\r\n```js\r\nimport { toCss } from '@ahmedsemih/color-fns';\r\n\r\ntoCss({ red: 255, green: 128, blue: 0 });\r\n// 'rgb(255, 128, 0)'\r\ntoCss({ red: 255, green: 128, blue: 0, alpha: 0.5 });\r\n// 'rgba(255, 128, 0, 0.5)'\r\ntoCss({ hue: 30, saturation: 100, lightness: 50 });\r\n// 'hsl(30, 100%, 50%)'\r\ntoCss({ hue: 30, saturation: 100, lightness: 50, alpha: 0.5 });\r\n// 'hsla(30, 100%, 50%, 0.5)'\r\n```\r\n\r\n#### <a id=\"rgbToHsl\"></a>`rgbToHsl(color: string | RgbColor): HslColor`\r\n\r\nConverts an RGB object or string to an HSL object.\r\n\r\n```js\r\nimport { rgbToHsl } from '@ahmedsemih/color-fns';\r\n\r\nrgbToHsl('rgb(255, 128, 0)');\r\n// { hue: 30, saturation: 100, lightness: 50 }\r\nrgbToHsl('rgba(255, 128, 0, 0.5)');\r\n// { hue: 30, saturation: 100, lightness: 50, alpha: 0.5 }\r\nrgbToHsl({ red: 255, green: 128, blue: 0 });\r\n// { hue: 30, saturation: 100, lightness: 50 }\r\nrgbToHsl({ red: 255, green: 128, blue: 0, alpha: 0.5 });\r\n// { hue: 30, saturation: 100, lightness: 50, alpha: 0.5 }\r\n```\r\n\r\n#### <a id=\"rgbToHex\"></a>`rgbToHex(color: string | RgbColor): string`\r\n\r\nConverts an RGB object or string to a HEX string.\r\n\r\n```js\r\nimport { rgbToHex } from '@ahmedsemih/color-fns';\r\n\r\nrgbToHex('rgb(255, 128, 0)');\r\n// '#ff8000'\r\nrgbToHex('rgba(255, 128, 0, 0.5)');\r\n// '#ff8000cc'\r\nrgbToHex({ red: 255, green: 128, blue: 0 });\r\n// '#ff8000'\r\nrgbToHex({ red: 255, green: 128, blue: 0, alpha: 0.5 });\r\n// '#ff8000cc'\r\n```\r\n\r\n#### <a id=\"hslToRgb\"></a>`hslToRgb(color: string | HslColor): RgbColor`\r\n\r\nConverts an HSL object or string to an RGB object.\r\n\r\n```js\r\nimport { hslToRgb } from '@ahmedsemih/color-fns';\r\n\r\nhslToRgb('hsl(30, 100%, 50%)');\r\n// { red: 255, green: 128, blue: 0 }\r\nhslToRgb('hsla(30, 100%, 50%, 0.5)');\r\n// { red: 255, green: 128, blue: 0, alpha: 0.5 }\r\nhslToRgb({ hue: 30, saturation: 100, lightness: 50 });\r\n// { red: 255, green: 128, blue: 0 }\r\nhslToRgb({ hue: 30, saturation: 100, lightness: 50, alpha: 0.5 });\r\n// { red: 255, green: 128, blue: 0, alpha: 0.5 }\r\n```\r\n\r\n#### <a id=\"hslToHex\"></a>`hslToHex(color: string | HslColor): string`\r\n\r\nConverts an HSL object or string to a HEX string.\r\n\r\n```js\r\nimport { hslToHex } from '@ahmedsemih/color-fns';\r\n\r\nhslToHex('hsl(30, 100%, 50%)');\r\n// '#ff8000'\r\nhslToHex('hsla(30, 100%, 50%, 0.5)');\r\n// '#ff8000cc'\r\nhslToHex({ hue: 30, saturation: 100, lightness: 50 });\r\n// '#ff8000'\r\nhslToHex({ hue: 30, saturation: 100, lightness: 50, alpha: 0.5 });\r\n// '#ff8000cc'\r\n```\r\n\r\n#### <a id=\"hexToRgb\"></a>`hexToRgb(color: string): RgbColor`\r\n\r\nConverts a HEX string to an RGB object.\r\n\r\n```js\r\nimport { hexToRgb } from '@ahmedsemih/color-fns';\r\n\r\nhexToRgb('#ff8000');\r\n// { red: 255, green: 128, blue: 0 }\r\nhexToRgb('#ff8000cc');\r\n// { red: 255, green: 128, blue: 0, alpha: 0.8 }\r\nhexToRgb('#f80');\r\n// { red: 255, green: 128, blue: 0 }\r\nhexToRgb('#f80c');\r\n// { red: 255, green: 128, blue: 0, alpha: 0.8 }\r\n```\r\n\r\n#### <a id=\"hexToHsl\"></a>`hexToHsl(color: string): HslColor`\r\n\r\nConverts a HEX string to an HSL object.\r\n\r\n```js\r\nimport { hexToHsl } from '@ahmedsemih/color-fns';\r\n\r\nhexToHsl('#ff8000');\r\n// { hue: 30, saturation: 100, lightness: 50 }\r\nhexToHsl('#ff8000cc');\r\n// { hue: 30, saturation: 100, lightness: 50, alpha: 0.8 }\r\nhexToHsl('#f80');\r\n// { hue: 30, saturation: 100, lightness: 50 }\r\nhexToHsl('#f80c');\r\n// { hue: 30, saturation: 100, lightness: 50, alpha: 0.8 }\r\n```\r\n\r\n### ✅ Validate\r\n\r\nValidates color strings and objects to ensure they are valid RGB, HSL, or HEX colors.\r\n\r\n#### <a id=\"isRgb\"></a>`isRgb(value: unknown): boolean`\r\n\r\nChecks if value is a valid RGB color.\r\n\r\n```js\r\nimport { isRgb } from '@ahmedsemih/color-fns';\r\n\r\nisRgb('rgb(255, 0, 0)');\r\n// true\r\nisRgb('rgba(0, 255, 0, 50%)');\r\n// true\r\nisRgb('rgb(30% 20% 50%)');\r\n// true\r\nisRgb('rgb(255 122 127 / 80%)');\r\n// true\r\nisRgb({ red: 0, green: 0, blue: 255 });\r\n// true\r\nisRgb({ red: 255, green: 0, blue: 0, alpha: 0.5 });\r\n// true\r\n\r\nisRgb('rgb(300, 0, 0)');\r\n// false (invalid red value)\r\nisRgb({ red: 255, green: 0 });\r\n// false (missing blue)\r\nisRgb('rgb(255, 0, 0, 1.5)');\r\n// false (invalid alpha value)\r\n```\r\n\r\n#### <a id=\"isHsl\"></a>`isHsl(value: unknown): boolean`\r\n\r\nChecks if value is a valid HSL color.\r\n\r\n```js\r\nimport { isHsl } from '@ahmedsemih/color-fns';\r\n\r\nisHsl('hsl(120, 100%, 50%)');\r\n// true\r\nisHsl('hsla(120, 100%, 50%, 0.5)');\r\n// true\r\nisHsl('hsl(120deg 100% 50%)');\r\n// true\r\nisHsl('hsl(0.3turn 60% 45% / 0.7)');\r\n// true\r\nisHsl({ hue: 120, saturation: 100, lightness: 50 });\r\n// true\r\nisHsl({ hue: 120, saturation: 100, lightness: 50, alpha: 0.5 });\r\n// true\r\n\r\nisHsl('hsl(400, 100%, 50%)');\r\n// false (invalid hue value)\r\nisHsl({ hue: 120, saturation: 100 });\r\n// false (missing lightness)\r\nisHsl('hsl(120, 100%, 50%, 1.5)');\r\n// false (invalid alpha value)\r\n```\r\n\r\n#### <a id=\"isHex\"></a>`isHex(value: unknown): boolean`\r\n\r\nChecks if value is a valid HEX color.\r\n\r\n```js\r\nimport { isHex } from '@ahmedsemih/color-fns';\r\n\r\nisHex('#ff8000');\r\n// true\r\nisHex('#f80');\r\n// true (short hex)\r\nisHex('#f80c');\r\n// true (short hex with alpha)\r\nisHex('#ff8000ff');\r\n// true (full hex with alpha)\r\n\r\nisHex('ff8000');\r\n// false (missing #)\r\nisHex('#ff8000g');\r\n// false (invalid character)\r\nisHex('rgb(255, 0, 0)');\r\n// false (not a hex string)\r\n```\r\n\r\n#### <a id=\"isValid\"></a>`isValid(value: unknown): boolean`\r\n\r\nChecks if value is a valid color in any supported format (RGB, HSL, HEX).\r\n\r\n```js\r\nimport { isValid } from '@ahmedsemih/color-fns';\r\n\r\nisValid('rgb(255, 0, 0)');\r\n// true\r\nisValid('hsl(120, 100%, 50%)');\r\n// true\r\nisValid('#ff8000');\r\n// true\r\nisValid({ red: 255, green: 0, blue: 0 });\r\n// true\r\nisValid({ hue: 120, saturation: 100, lightness: 50 });\r\n// true\r\n\r\nisValid('invalid color');\r\n// false\r\nisValid('rgb(300, 0, 0)');\r\n// false (invalid RGB)\r\nisValid('hsl(400, 100%, 50%)');\r\n// false (invalid HSL)\r\nisValid('#ff8000g');\r\n// false (invalid HEX)\r\n```\r\n\r\n### 🎲 Generate\r\n\r\nGenerates random colors in RGB, HSL, or HEX formats.\r\n\r\n#### <a id=\"randomRgb\"></a>`randomRgb(): RgbColor`\r\n\r\nGenerates a random RGB color object.\r\n\r\n```js\r\nimport { randomRgb } from '@ahmedsemih/color-fns';\r\n\r\nrandomRgb();\r\n// { red: 34, green: 67, blue: 89 }\r\n```\r\n\r\n#### <a id=\"randomHsl\"></a>`randomHsl(): HslColor`\r\n\r\nGenerates a random HSL color object.\r\n\r\n```js\r\nimport { randomHsl } from '@ahmedsemih/color-fns';\r\n\r\nrandomHsl();\r\n// { hue: 240, saturation: 67, lightness: 89 }\r\n```\r\n\r\n#### <a id=\"randomHex\"></a>`randomHex(): string`\r\n\r\nGenerates a random HEX color string.\r\n\r\n```js\r\nimport { randomHex } from '@ahmedsemih/color-fns';\r\n\r\nrandomHex();\r\n// '#ff8000'\r\n```\r\n\r\n#### <a id=\"generateShades\"></a>`generateShades(color: Color, count?: number): Color[]`\r\n\r\nGenerates an array of shades for a given color. Shades are darker variations of the base color.\r\n\r\n```js\r\nimport { generateShades } from '@ahmedsemih/color-fns';\r\n\r\ngenerateShades('#FF8000', 3);\r\n// ['#FF8000', '#AA5500', '#552A00']\r\ngenerateShades('rgb(255, 128, 0)', 3);\r\n// ['rgb(255, 128, 0)', 'rgb(170, 85, 0)', 'rgb(85, 42, 0)']\r\ngenerateShades('hsl(30, 100%, 50%)', 5);\r\n// ['hsl(30, 100%, 50%)', 'hsl(30, 100%, 40%)', 'hsl(30, 100%, 30%)', 'hsl(30, 100%, 20%)', 'hsl(30, 100%, 10%)']\r\ngenerateShades({ red: 255, green: 128, blue: 0 }, 2);\r\n// [{ red: 255, green: 128, blue: 0 }, { red: 128, green: 64, blue: 0 }]\r\ngenerateShades({ hue: 30, saturation: 100, lightness: 60 }, 3);\r\n// [{ hue: 30, saturation: 100, lightness: 60 }, { hue: 30, saturation: 100, lightness: 40 }, { hue: 30, saturation: 100, lightness: 20 }]\r\n```\r\n\r\n#### <a id=\"generateTints\"></a>`generateTints(color: Color, count?: number): Color[]`\r\n\r\nGenerates an array of tints for a given color. Tints are lighter variations of the base color.\r\n\r\n```js\r\nimport { generateTints } from '@ahmedsemih/color-fns';\r\n\r\ngenerateTints('#ff8000', 3);\r\n// ['#FF8000', '#FFAA55', '#FFD5AA']\r\ngenerateTints('rgb(255, 128, 0)', 2);\r\n// ['rgb(255, 128, 0)', 'rgb(255, 191, 128)']\r\ngenerateTints('hsl(30, 100%, 50%)', 4);\r\n// ['hsl(30, 100%, 50%)', 'hsl(30, 100%, 62.5%)', 'hsl(30, 100%, 75%)', 'hsl(30, 100%, 87.5%)']\r\ngenerateTints({ red: 255, green: 128, blue: 0 }, 2);\r\n// [{ red: 255, green: 128, blue: 0 }, { red: 255, green: 191, blue: 128 }]\r\ngenerateTints({ hue: 30, saturation: 100, lightness: 60 }, 3);\r\n// [{ hue: 30, saturation: 100, lightness: 60 }, { hue: 30, saturation: 100, lightness: 80 }, { hue: 30, saturation: 100, lightness: 100 }]\r\n```\r\n\r\n#### <a id=\"generateTones\"></a>`generateTones(color: Color, count?: number): Color[]`\r\n\r\nGenerates an array of tones for a given color. Tones are variations of the base color with added gray.\r\n\r\n```js\r\nimport { generateTones } from '@ahmedsemih/color-fns';\r\n\r\ngenerateTones('#FF8000', 3);\r\n// ['#FF8000', '#D4802B', '#AA8055']\r\ngenerateTones('rgb(255, 128, 0)', 2);\r\n// ['rgb(255, 128, 0)', 'rgb(191, 128, 64)']\r\ngenerateTones('hsl(30, 100%, 50%)', 4);\r\n// ['hsl(30, 100%, 50%)', 'hsl(30, 75%, 50%)', 'hsl(30, 50%, 50%)', 'hsl(30, 25%, 50%)']\r\ngenerateTones({ red: 255, green: 128, blue: 0 }, 2);\r\n// [{ red: 255, green: 128, blue: 0 }, { red: 191, green: 128, blue: 64 }]\r\ngenerateTones({ hue: 30, saturation: 90, lightness: 50 }, 3);\r\n// [{ hue: 30, saturation: 90, lightness: 50 }, { hue: 30, saturation: 60, lightness: 50 }, { hue: 30, saturation: 30, lightness: 50 }]\r\n```\r\n\r\n### 🛠️ Manipulate\r\n\r\nManipulates colors by mixing, lightening, darkening, saturating, desaturating, converting to grayscale, inverting, and setting alpha values.\r\n\r\n#### <a id=\"mix\"></a>`mix(color1: Color, color2: Color, weight?: number): Color`\r\n\r\nMixes two colors together based on a specified weight. Default weight is 0.5 (equal mix).\r\nReturns a new color in the same format as the first color.\r\n\r\n```js\r\nimport { mix } from '@ahmedsemih/color-fns';\r\n\r\nmix('rgb(255, 0, 0)', 'rgb(0, 0, 255)');\r\n// 'rgb(128, 0, 128)'\r\nmix('hsl(120, 100%, 50%)', 'hsl(240, 100%, 50%)');\r\n// 'hsl(180, 100%, 25%)'\r\nmix('#ff8000', '#0080ff', 0.25);\r\n// '#4080BF'\r\nmix({ red: 255, green: 0, blue: 0 }, { hue: 240, saturation: 100, lightness: 50 });\r\n// { red: 128, green: 0, blue: 128, alpha: 1 }\r\nmix({ hue: 120, saturation: 100, lightness: 50 }, { red: 0, green: 0, blue: 255 }, 0.75);\r\n// { hue: 140, saturation: 100, lightness: 37, alpha: 1 }\r\n```\r\n\r\n#### <a id=\"lighten\"></a>`lighten(color: Color, amount: number): Color`\r\n\r\nLightens a color by a specified amount (0-100). Returns a new color in the same format as the input.\r\n\r\n```js\r\nimport { lighten } from '@ahmedsemih/color-fns';\r\n\r\nlighten('rgb(100, 150, 200)', 0.2);\r\n// 'rgb(176, 201, 227)'\r\nlighten('hsl(200, 50%, 50%)', 0.2);\r\n// 'hsl(200, 50%, 70%)'\r\nlighten('#6496c8', 20);\r\n// '#B0C9E3'\r\nlighten({ red: 100, green: 150, blue: 200 }, 20);\r\n// { red: 176, green: 201, blue: 227 }\r\nlighten({ hue: 200, saturation: 50, lightness: 50 }, 20);\r\n// { hue: 200, saturation: 50, lightness: 70 }\r\n```\r\n\r\n#### <a id=\"darken\"></a>`darken(color: Color, amount: number): Color`\r\n\r\nDarkens a color by a specified amount (0-100). Returns a new color in the same format as the input.\r\n\r\n```js\r\nimport { darken } from '@ahmedsemih/color-fns';\r\n\r\ndarken('rgb(100, 150, 200)', 0.2);\r\n// 'rgb(52, 99, 147)'\r\ndarken('hsl(200, 50%, 50%)', 20);\r\n// 'hsl(200, 50%, 30%)'\r\ndarken('#6496c8', 20);\r\n// '#346393'\r\ndarken({ red: 100, green: 150, blue: 200 }, 0.2);\r\n// { red: 52, green: 99, blue: 147 }\r\ndarken({ hue: 200, saturation: 50, lightness: 50 }, 0.2);\r\n// { hue: 200, saturation: 50, lightness: 30 }\r\n```\r\n\r\n#### <a id=\"saturate\"></a>`saturate(color: Color, amount: number): Color`\r\n\r\nIncreases the saturation of a color by a specified amount (0-100). Returns a new color in the same format as the input.\r\n\r\n```js\r\nimport { saturate } from '@ahmedsemih/color-fns';\r\n\r\nsaturate('rgb(100, 150, 200)', 0.2);\r\n// 'rgb(79, 150, 222)'\r\nsaturate('hsl(200, 50%, 50%)', 20);\r\n// 'hsl(200, 70%, 50%)'\r\nsaturate('#6496c8', 20);\r\n// '#4F96DE'\r\nsaturate({ red: 100, green: 150, blue: 200 }, 20);\r\n// { red: 79, green: 150, blue: 222 }\r\nsaturate({ hue: 200, saturation: 50, lightness: 50 }, 20);\r\n// { hue: 200, saturation: 70, lightness: 50 }\r\n```\r\n\r\n#### <a id=\"desaturate\"></a>`desaturate(color: Color, amount: number): Color`\r\n\r\nDecreases the saturation of a color by a specified amount (0-100). Returns a new color in the same format as the input.\r\n\r\n```js\r\nimport { desaturate } from '@ahmedsemih/color-fns';\r\n\r\ndesaturate('rgb(100, 150, 200)', 20);\r\n// 'rgb(121, 150, 180)'\r\ndesaturate('hsl(200, 50%, 50%)', 20);\r\n// 'hsl(200, 30%, 50%)'\r\ndesaturate('#6496c8', 0.2);\r\n// '#7996B4'\r\ndesaturate({ red: 100, green: 150, blue: 200 }, 0.2);\r\n// { red: 121, green: 150, blue: 180 }\r\ndesaturate({ hue: 200, saturation: 50, lightness: 50 }, 20);\r\n// { hue: 200, saturation: 30, lightness: 50 }\r\n```\r\n\r\n#### <a id=\"grayscale\"></a>`grayscale(color: Color): Color`\r\n\r\nConverts a color to grayscale. Returns a new color in the same format as the input.\r\n\r\n```js\r\nimport { grayscale } from '@ahmedsemih/color-fns';\r\n\r\ngrayscale('rgb(100, 150, 200)');\r\n// 'rgb(150, 150, 150)'\r\ngrayscale('hsl(210, 50%, 50%)');\r\n// 'hsl(210, 0%, 50%)'\r\ngrayscale('#6496c8');\r\n// '#969696'\r\ngrayscale({ red: 100, green: 150, blue: 200 });\r\n// { red: 150, green: 150, blue: 150 }\r\ngrayscale({ hue: 210, saturation: 50, lightness: 50 });\r\n// { hue: 210, saturation: 0, lightness: 50 }\r\n```\r\n\r\n#### <a id=\"invert\"></a>`invert(color: Color): Color`\r\n\r\nInverts a color to its complementary color. Returns a new color in the same format as the input.\r\n\r\n```js\r\nimport { invert } from '@ahmedsemih/color-fns';\r\n\r\ninvert('rgb(255, 0, 0)');\r\n// 'rgb(0, 255, 255)'\r\ninvert('hsl(0, 100%, 50%)');\r\n// 'hsl(180, 100%, 50%)'\r\ninvert('#ff0000');\r\n// '#00FFFF'\r\ninvert({ red: 255, green: 0, blue: 0 });\r\n// { red: 0, green: 255, blue: 255 }\r\ninvert({ hue: 0, saturation: 100, lightness: 50 });\r\n// { hue: 180, saturation: 100, lightness: 50 }\r\n```\r\n\r\n#### <a id=\"setAlpha\"></a>`setAlpha(color: Color, alpha: number): Color`\r\n\r\nSets the alpha (opacity) of a color. Returns a new color in the same format as the input.\r\n\r\n```js\r\nimport { setAlpha } from '@ahmedsemih/color-fns';\r\n\r\nsetAlpha('rgb(255, 0, 0)', 0.5);\r\n// 'rgba(255, 0, 0, 0.5)'\r\nsetAlpha('hsl(0, 100%, 50%)', 0.75);\r\n// 'hsla(0, 100%, 50%, 0.75)'\r\nsetAlpha('#ff0000', 0.3);\r\n// '#ff00004c'\r\nsetAlpha({ red: 255, green: 0, blue: 0 }, 0.8);\r\n// { red: 255, green: 0, blue: 0, alpha: 0.8 }\r\nsetAlpha({ hue: 0, saturation: 100, lightness: 50 }, 0.6);\r\n// { hue: 0, saturation: 100, lightness: 50, alpha: 0.6 }\r\n```\r\n\r\n### 🔍 Parse\r\n\r\nParse functions convert color strings into structured, easy-to-use object representations.\r\n\r\n#### <a id=\"parseRgb\"></a>`parseRgb(color: string): RgbColor`\r\n\r\nParses an RGB color string into an `RgbColor` object.\r\n\r\n```js\r\nimport { parseRgb } from '@ahmedsemih/color-fns';\r\n\r\nparseRgb('rgb(255, 128, 0)');\r\n// { red: 255, green: 128, blue: 0 }\r\nparseRgb('rgba(255, 128, 0, 0.5)');\r\n// { red: 255, green: 128, blue: 0, alpha: 0.5 }\r\n```\r\n\r\n#### <a id=\"parseHsl\"></a>`parseHsl(color: string): HslColor`\r\n\r\nParses an HSL color string into an `HslColor` object.\r\n\r\n```js\r\nimport { parseHsl } from '@ahmedsemih/color-fns';\r\n\r\nparseHsl('hsl(30, 100%, 50%)');\r\n// { hue: 30, saturation: 100, lightness: 50 }\r\nparseHsl('hsla(30, 100%, 50%, 0.5)');\r\n// { hue: 30, saturation: 100, lightness: 50, alpha: 0.5 }\r\n```\r\n\r\n#### <a id=\"parseHex\"></a>`parseHex(color: string): RgbColor`\r\n\r\nParses a hexadecimal color string into an `RgbColor` object.\r\n\r\n```js\r\nimport { parseHex } from '@ahmedsemih/color-fns';\r\n\r\nparseHex('#ff8000');\r\n// { red: 255, green: 128, blue: 0 }\r\nparseHex('#ff8000cc');\r\n// { red: 255, green: 128, blue: 0, alpha: 0.8 }\r\n```\r\n\r\n#### <a id=\"parseAlpha\"></a>`parseAlpha(alpha: string | number): number`\r\n\r\nParses an alpha value from a string or number into a normalized float between 0 and 1.\r\n\r\n```js\r\nimport { parseAlpha } from '@ahmedsemih/color-fns';\r\n\r\nparseAlpha('0.5'); // 0.5\r\nparseAlpha('50%'); // 0.5\r\nparseAlpha(0.75); // 0.75\r\n```\r\n\r\n#### <a id=\"parseHue\"></a>`parseHue(hue: string | number): number`\r\n\r\nParses a hue value from a string or number into a normalized float between 0 and 360.\r\n\r\n```js\r\nimport { parseHue } from '@ahmedsemih/color-fns';\r\n\r\nparseHue('180deg'); // 180\r\nparseHue('3.14rad'); // 180\r\nparseHue('0.5turn'); // 180\r\nparseHue('90grad'); // 81\r\nparseHue(180); // 180\r\n```\r\n\r\n#### <a id=\"parseChannel\"></a>`parseChannel(channel: string | number): number`\r\n\r\nParses a color channel value from a string or number into a normalized integer between 0 and 255.\r\n\r\n```js\r\nimport { parseChannel } from '@ahmedsemih/color-fns';\r\n\r\nparseChannel('128'); // 128\r\nparseChannel('50%'); // 128\r\nparseChannel(128); // 128\r\n```\r\n\r\n### 📐 Types\r\n\r\n#### <a id=\"RgbColor\"></a>`RgbColor`\r\n\r\nAn object representing an RGB color.\r\n\r\n```ts\r\ntype RgbColor = {\r\n  red: number;\r\n  green: number;\r\n  blue: number;\r\n  alpha?: number;\r\n};\r\n```\r\n\r\n#### <a id=\"HslColor\"></a>`HslColor`\r\n\r\nAn object representing an HSL color.\r\n\r\n```ts\r\ntype HslColor = {\r\n  hue: number;\r\n  saturation: number;\r\n  lightness: number;\r\n  alpha?: number;\r\n};\r\n```\r\n\r\n#### <a id=\"Color\"></a>`Color`\r\n\r\nA union type representing any color format (RGB, HSL, HEX).\r\n\r\n```ts\r\ntype Color = RgbColor | HslColor | string; // string for HEX or CSS\r\n```\r\n\r\n## 🤝 Contributing\r\n\r\nContributions are welcome! Found a bug or have an idea?\r\nCheck out [contributing guideline](CONTRIBUTING.md) to get started.\r\n\r\n## 📄 License\r\n\r\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\r\n","readmeFilename":"README.md"}