{"id":13808556,"url":"https://github.com/ngx-eco/angular-colorful","last_synced_at":"2025-05-14T02:32:01.638Z","repository":{"id":57178183,"uuid":"299094854","full_name":"ngx-eco/angular-colorful","owner":"ngx-eco","description":"A tiny color picker component for modern Angular apps","archived":false,"fork":false,"pushed_at":"2024-06-06T14:21:32.000Z","size":3490,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-11T21:54:15.218Z","etag":null,"topics":["angular","color-picker","typescript"],"latest_commit_sha":null,"homepage":"https://angular-colorful.ru","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/ngx-eco.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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":"2020-09-27T18:34:14.000Z","updated_at":"2024-06-29T08:05:00.000Z","dependencies_parsed_at":"2024-06-19T03:02:51.830Z","dependency_job_id":"51b4421e-41f0-46f3-b435-8600fb413625","html_url":"https://github.com/ngx-eco/angular-colorful","commit_stats":null,"previous_names":["fil0157/angular-colorful"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngx-eco%2Fangular-colorful","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngx-eco%2Fangular-colorful/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngx-eco%2Fangular-colorful/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngx-eco%2Fangular-colorful/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ngx-eco","download_url":"https://codeload.github.com/ngx-eco/angular-colorful/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225273247,"owners_count":17448074,"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":["angular","color-picker","typescript"],"created_at":"2024-08-04T01:01:46.087Z","updated_at":"2024-11-19T00:30:49.688Z","avatar_url":"https://github.com/ngx-eco.png","language":"TypeScript","funding_links":[],"categories":["Third Party Components"],"sub_categories":["Form Controls"],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://fil0157.github.io/angular-colorful\"\u003e\n    \u003cimg src=\"src/app/src/assets/design.png\" width=\"242\" height=\"242\" alt=\"angular-colorful\" /\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://npmjs.org/package/angular-colorful\"\u003e\n    \u003cimg alt=\"npm\" src=\"https://img.shields.io/npm/v/angular-colorful.svg?labelColor=da248d\u0026color=6ead0a\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://travis-ci.org/fil0157/angular-colorful\"\u003e\n    \u003cimg alt=\"build\" src=\"https://img.shields.io/travis/fil0157/angular-colorful/master.svg?branch=master\u0026labelColor=da248d\u0026color=6ead0a\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://npmjs.org/package/angular-colorful\"\u003e\n    \u003cimg alt=\"no dependencies\" src=\"https://img.shields.io/david/fil0157/angular-colorful.svg?labelColor=da248d\u0026color=6ead0a\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://bundlephobia.com/result?p=angular-colorful\"\u003e\n    \u003cimg alt=\"tree-shakeable\" src=\"https://badgen.net/bundlephobia/tree-shaking/angular-colorful?labelColor=da248d\u0026color=6ead0a\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://npmjs.org/package/angular-colorful\"\u003e\n    \u003cimg alt=\"types included\" src=\"https://badgen.net/npm/types/angular-colorful?labelColor=da248d\u0026color=6ead0a\" /\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003cstrong\u003eAngular-colorful\u003c/strong\u003e is a tiny color picker component for modern Angular apps.\n\u003c/div\u003e\n\n## Table of Contents\n\n- [Features](#Features)\n- [Demo](#Demo)\n- [Quickstart](#Quickstart)\n- [Usage](#Usage)\n- [Supported color models](#Supported-color-models)\n\n\u003c!-- - [Overriding styles](#Overriding-styles) --\u003e\n\u003c!-- - [How to paste or type a color?](#How-to-paste-or-type-a-color?) --\u003e\n\n- [TypeScript support](#TypeScript-support)\n\n\u003c!-- - [Why angular-colorful?](#Why-angular-colorful?) --\u003e\n\u003c!-- - [Projects using angular-colorful](#Projects-using-angular-colorful) --\u003e\n\u003c!-- - [Browser support](#Browser-support) --\u003e\n\n- [Ports](#Ports)\n- [Roadmap](#Roadmap)\n- [Changelog](#Changelog)\n- [Copyright](#Copyright)\n- [MIT License](#MIT-License)\n\n## Features\n\n- **Small**: Just 2,6 KB (minified and gzipped). [Size Limit](https://github.com/ai/size-limit) controls the size.\n- **Tree-shakeable**: Only the parts you use will be imported into your app's bundle.\n\n\u003c!-- - **Fast**: Built with hooks and functional components only. --\u003e\n\u003c!-- - **Bulletproof**: Written in strict TypeScript and covered by 40+ tests. --\u003e\n\n- **Simple**: The interface is straight forward and easy to use.\n- **Mobile-friendly**: Works well on mobile devices and touch screens.\n\n\u003c!-- - **Accessible**: Follows the [WAI-ARIA](https://www.w3.org/WAI/standards-guidelines/aria/) guidelines to support users of assistive technologies. --\u003e\n\n- **No dependencies**\n\n## Demo\n\n- [Website](https://angular-colorful.ru/)\n\n\u003c!-- - [HEX Color Picker (CodeSandbox)](https://codesandbox.io/s/react-colorful-demo-u5vwp)\n- [RGBA Color Picker (CodeSandbox)](https://codesandbox.io/s/react-colorful-rgb-o9q0t) --\u003e\n\n## Quickstart\n\n**Install with [npm](https://www.npmjs.com):**\n\n``` bash\nnpm install angular-colorful --save\n```\n\n**Install with [yarn](https://yarnpkg.com/):**\n\n``` bash\nyarn add angular-colorful\n```\n\n**Clone the repo:**\n\n``` bash\ngit clone https://github.com/fil0157/angular-colorful.git\n```\n\n## Usage\n\n### app.module.ts\n\n```ts\nimport {NgModule} from '@angular/core';\nimport {BrowserModule} from '@angular/platform-browser';\nimport {AppComponent} from './app.component';\n\nimport {AngularColorfulModule} from 'angular-colorful';\n\n@NgModule({\n  declarations: [\n    AppComponent\n  ],\n  imports: [\n    BrowserModule,\n    AngularColorfulModule,\n  ],\n  providers: [],\n  bootstrap: [AppComponent]\n})\nexport class AppModule {\n}\n```\n\n### app.component.ts\n\n```ts\nimport {Component} from '@angular/core';\n\nimport {RgbaColor} from 'angular-colorful';\n\n@Component({\n  selector: 'app-root',\n  templateUrl: './app.component.html',\n  styleUrls: ['./app.component.scss']\n})\nexport class AppComponent {\n\n  color: RgbaColor = {r: 255, g: 255, b: 255};\n\n  colorChanged(color): void {\n    this.color = color;\n  }\n\n}\n```\n\n### app.component.html\n\n```html\n\n\u003crgba-color-picker\n  [color]=\"color\"\n  (colorChanged)=\"colorChanged($event)\"\u003e\n\u003c/rgba-color-picker\u003e\n```\n\n## Supported color models\n\nWe provide 13 additional color picker components for different color models, unless your app needs a HEX string as an\ninput/output format.\n\n\u003cdetails\u003e\n  \u003csummary\u003eHow to use another color model\u003c/summary\u003e\n\n#### Available pickers\n\n| Import                      | Value example                      |\n|-----------------------------|------------------------------------|\n| `{ HexColorPicker }`        | `\"#ffffff\"`                        |\n| `{ RgbColorPicker }`        | `{ r: 255, g: 255, b: 255 }`       |\n| `{ RgbaColorPicker }`       | `{ r: 255, g: 255, b: 255, a: 1 }` |\n| `{ RgbStringColorPicker }`  | `\"rgb(255, 255, 255)\"`             |\n| `{ RgbaStringColorPicker }` | `\"rgba(255, 255, 255, 1)\"`         |\n| `{ HslColorPicker }`        | `{ h: 0, s: 0, l: 100 }`           |\n| `{ HslaColorPicker }`       | `{ h: 0, s: 0, l: 100, a: 1 }`     |\n| `{ HslStringColorPicker }`  | `\"hsl(0, 0%, 100%)\"`               |\n| `{ HslaStringColorPicker }` | `\"hsla(0, 0%, 100%, 1)\"`           |\n| `{ HsvColorPicker }`        | `{ h: 0, s: 0, v: 100 }`           |\n| `{ HsvaColorPicker }`       | `{ h: 0, s: 0, v: 100, a: 1 }`     |\n| `{ HsvStringColorPicker }`  | `\"hsv(0, 0%, 100%)\"`               |\n| `{ HsvaStringColorPicker }` | `\"hsva(0, 0%, 100%, 1)\"`           |\n\n\u003c!-- [Live demo →](https://codesandbox.io/s/react-colorful-rgb-o9q0t) --\u003e\n\n\u003c/details\u003e\n\n\u003c!-- ## Overriding styles\n\nThe easiest way to tweak react-colorful is to create another stylesheet to override the default styles.\n\n```css\n.react-colorful {\n  height: 250px;\n}\n.react-colorful__saturation {\n  border-radius: 3px 3px 0 0;\n}\n.react-colorful__hue {\n  height: 30px;\n  border-radius: 0 0 3px 3px;\n}\n.react-colorful__saturation-pointer {\n  border-radius: 5px;\n}\n.react-colorful__hue-pointer {\n  border-radius: 2px;\n  width: 15px;\n  height: inherit;\n}\n```\n\n[See examples →](https://codesandbox.io/s/react-colorful-customization-demo-mq85z?file=/src/styles.css) --\u003e\n\n\u003c!-- ## How to paste or type a color?\n\nAs you probably noticed the color picker itself does not include an input field, but do not worry if you need one. **react-colorful** is a modular library that allows you to build any picker you need. Since `v2.1` we provide an additional component that works perfectly in pair with our color picker.\n\n\u003cdetails\u003e\n  \u003csummary\u003eHow to use \u003ccode\u003eHexColorInput\u003c/code\u003e\u003c/summary\u003e\u003cbr /\u003e\n\n```js\nimport { HexColorPicker, HexColorInput } from \"react-colorful\";\nimport \"react-colorful/dist/index.css\";\n\nconst YourComponent = () =\u003e {\n  const [color, setColor] = useState(\"#aabbcc\");\n  return (\n    \u003cdiv\u003e\n      \u003cHexColorPicker color={color} onChange={setColor} /\u003e\n      \u003cHexColorInput color={color} onChange={setColor} /\u003e\n    \u003c/div\u003e\n  );\n};\n```\n\n[Live demo →](https://codesandbox.io/s/react-colorful-hex-input-demo-0k2fx)\n\n`HexColorInput` does not have any default styles, but accepts all properties that a regular `input` tag does (such as `className`, `placeholder` and `autoFocus`). That means you can place and modify this component as you like. Also, that allows you to combine the color picker and input in different ways.\n\n\u003c/details\u003e --\u003e\n\n## TypeScript support\n\n**angular-colorful** supports TypeScript and ships with types in the library itself; no need for any other install.\n\n\u003cdetails\u003e\n  \u003csummary\u003eHow you can get the most from our TypeScript support\u003c/summary\u003e\u003cbr /\u003e\n\nWhile not only typing its own functions and variables, it can also help you type yours. Depending on the component you\nare using, you can also import the type that is associated with the component. For example, if you are using our HSL\ncolor picker component, you can also import the `HSL` type.\n\n```ts\nimport {HslColorPicker, HslColor} from \"angular-colorful\";\n\nconst myHslValue: HslColor = {h: 0, s: 0, l: 0};\n```\n\nTake a look at [Supported Color Models](#supported-color-models) for more information about the types and color formats\nyou may want to use.\n\n\u003c/details\u003e\n\n\u003c!-- ## Why angular-colorful?\n\nToday each dependency drags more dependencies and increases your project’s bundle size uncontrollably. But size is very important for everything that intends to work in a browser.\n\n**angular-colorful** is a simple color picker for those who care about their bundle size and client-side performance. It is fast and lightweight because:\n\n- has no dependencies (no risks in terms of vulnerabilities, no unexpected bundle size changes);\n- built with hooks and functional components only (no classes and polyfills for them);\n- ships only a minimal amount of manually optimized color conversion algorithms (while most of the popular pickers import entire color manipulation libraries that increase the bundle size by more than 10 KB and make your app slower).\n\nTo show you the problem that **angular-colorful** is trying to solve, we have performed a simple benchmark (using [bundlephobia.com](https://bundlephobia.com)) against popular React color picker libraries:\n\n| Name               | Bundle size                                                                                                                        | Bundle size (gzip)                                                                                                                    | Dependencies                                                                                                                                    |\n| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |\n| **react-colorful** | [![](https://badgen.net/bundlephobia/min/react-colorful?color=6ead0a\u0026label=)](https://bundlephobia.com/result?p=react-colorful)    | [![](https://badgen.net/bundlephobia/minzip/react-colorful?color=6ead0a\u0026label=)](https://bundlephobia.com/result?p=react-colorful)    | [![](https://badgen.net/bundlephobia/dependency-count/react-colorful?color=6ead0a\u0026label=)](https://bundlephobia.com/result?p=react-colorful)    |\n| react-color        | [![](https://badgen.net/bundlephobia/min/react-color?color=red\u0026label=)](https://bundlephobia.com/result?p=react-color)             | [![](https://badgen.net/bundlephobia/minzip/react-color?color=red\u0026label=)](https://bundlephobia.com/result?p=react-color)             | [![](https://badgen.net/bundlephobia/dependency-count/react-color?color=red\u0026label=)](https://bundlephobia.com/result?p=react-color)             |\n| react-input-color  | [![](https://badgen.net/bundlephobia/min/react-input-color?color=red\u0026label=)](https://bundlephobia.com/result?p=react-input-color) | [![](https://badgen.net/bundlephobia/minzip/react-input-color?color=red\u0026label=)](https://bundlephobia.com/result?p=react-input-color) | [![](https://badgen.net/bundlephobia/dependency-count/react-input-color?color=red\u0026label=)](https://bundlephobia.com/result?p=react-input-color) |\n| rc-color-picker    | [![](https://badgen.net/bundlephobia/min/rc-color-picker?color=red\u0026label=)](https://bundlephobia.com/result?p=rc-color-picker)     | [![](https://badgen.net/bundlephobia/minzip/rc-color-picker?color=red\u0026label=)](https://bundlephobia.com/result?p=rc-color-picker)     | [![](https://badgen.net/bundlephobia/dependency-count/rc-color-picker?color=red\u0026label=)](https://bundlephobia.com/result?p=rc-color-picker)     | --\u003e\n\n\u003c!-- ## Projects using angular-colorful\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ca href=\"https://resume.io\"\u003eResume.io\u003c/a\u003e — online resume builder with over 7,800,000 users worldwide\u003c/summary\u003e\n\n  \u003ca href=\"https://resume.io/\"\u003e\n    \u003cimg src=\"demo/src/assets/resume-io.png\" width=\"873\" alt=\"resume.io\" /\u003e\n  \u003c/a\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ca href=\"https://omatsuri.app\"\u003eOmatsuri.app\u003c/a\u003e — progressive web application with a lot of different frontend focused tools\u003c/summary\u003e\n\n  \u003ca href=\"https://omatsuri.app\"\u003e\n    \u003cimg src=\"demo/src/assets/omatsuri-app.png\" width=\"1223\" alt=\"omatsuri.app\" /\u003e\n  \u003c/a\u003e\n\u003c/details\u003e --\u003e\n\n\u003c!-- ## Browser support\n\nIt would be an easier task to list all of the browsers and versions that **react-colorful** does not support! We regularly test against browser versions going all the way back to 2013 and this includes IE11.\n\n**react-colorful** works out-of-the-box for most browsers, regardless of version, and only requires an `Object.assign` polyfill be provided for full IE11 support. --\u003e\n\n## Ports\n\nNot using Angular? No problem! Angular-colorful ported from react-colorful. All the ported projects can be\nviewed [here](https://github.com/omgovich/react-colorful#ports).\n\n## Roadmap\n\n- [x] Additional modules to support RGB, HSL and HSV color models\n- [x] TypeScript support\n- [x] Rewrite the codebase to TypeScript\n- [x] Alpha channel support (RGBA, HSLA and HSVA color models)\n- [ ] HEX input component\n- [ ] Accessibility\n\n## Changelog\n\nFor changelogs, check\nout [the Releases section of angular-colorful](https://github.com/fil0157/angular-colorful/releases)\nor the [CHANGELOG.md](CHANGELOG.md).\n\n## Copyright\n\nCode Copyright 2020 angular-colorful.\n\n## MIT License\n\nCopyright (c) 2020 angular-colorful\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fngx-eco%2Fangular-colorful","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fngx-eco%2Fangular-colorful","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fngx-eco%2Fangular-colorful/lists"}