npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

ngx-input-color

v5.0.0

Published

Angular color input component and color picker (with HSL, HSV, RGB, CMYK, HEX, alpha, eye-dropper, etc)

Readme

ngx-input-color & ngx-input-gradient

npm version MIT License

ngx-input-color and ngx-input-gradient are powerful, customizable Angular components for color and gradient picking. They support multiple color formats, real-time preview, inline and input modes, and seamless integration with Angular forms.

🚀 Live Demo

View Demo

Screenshot


✨ Features

  • Multiple Color Formats: HEX, RGBA, HSLA, HSVA, CMYK (for color), and full CSS gradients (for gradient)
  • Interactive UI: Drag-and-drop sliders for hue, saturation, lightness, alpha, and more
  • Angular Forms Integration: Works with ngModel and reactive forms
  • EyeDropper API Support: Pick colors from anywhere on your screen (if supported)
  • Live Preview: Instantly see the selected color or gradient
  • Highly Customizable: set input background color, Simple mode and more
  • Inline & Input Modes: Use as a popup input or as an always-visible inline component
  • Unit Tested: Includes comprehensive unit tests

📦 Installation

npm install ngx-input-color
# or
yarn add ngx-input-color
# or
pnpm add ngx-input-color

🛠️ Usage

1. Import the Module

import { NgxInputColorModule } from 'ngx-input-color';

2. Input Mode (Popup)

Color Picker Input

<input ngxInputColor [(ngModel)]="color" />
<span>Selected: {{ color }}</span>

Gradient Picker Input

<input ngxInputGradient [(ngModel)]="gradient" />
<span>Selected: {{ gradient }}</span>

3. Inline Mode (Always Visible)

Inline Color Picker

<ngx-input-color [(ngModel)]="inlineColor" [simpleMode]="false"></ngx-input-color>
<span>Selected: {{ inlineColor }}</span>

Inline Gradient Picker

<ngx-input-gradient [(ngModel)]="inlineGradient"></ngx-input-gradient>
<span>Selected: {{ inlineGradient }}</span>

📚 API Reference

NgxInputColor (Input & Inline)

| Name | Type | Default | Description | | ----------------------------- | ---------------------- | --------- | ---------------------------------------------- | | setInputBackgroundColor | boolean | true | Set input background to selected color | | simpleMode | boolean | false | Compact UI for inline use | | defaultInspector | ColorInspector enum | Picker | Default inspector (Picker, RGB, HSL, CMYK) | | [(ngModel)] / formControl | string | | Two-way binding for the selected color | | change (Output) | EventEmitter<string> | | Emits the color value on change |

Supported Color Formats

  • HEX (#RRGGBB or #RRGGBBAA)
  • RGBA (rgba(255,255,255,1))
  • HSLA (hsla(360,100%,100%,1))
  • HSVA
  • CMYK

NgxInputGradient (Input & Inline)

| Name | Type | Default | Description | | ----------------------------- | ---------------------- | --------- | ---------------------------------------------- | | [(ngModel)] / formControl | string | | Two-way binding for the selected gradient | | change (Output) | EventEmitter<string> | | Emits the gradient value on change |

Supported Gradient Formats

  • CSS Linear Gradients (e.g. linear-gradient(90deg, #ff0000 0%, #00ff00 100%))
  • CSS Radial Gradients (e.g. radial-gradient(circle, #ff0000 0%, #00ff00 100%))

⚙️ Customization

  • visibility, and UI modes are fully customizable via component inputs.
  • Works seamlessly with both Template-driven and Reactive Forms.

🧪 Testing & Development

  • This library includes comprehensive unit tests. Run ng test to verify functionality.
  • Contributions are welcome! Please open an issue or submit a pull request.

❓ FAQ

  • Can I programmatically set the color/gradient?
    Yes, simply update the variable bound to ngModel or your form control.

  • Is EyeDropper API supported?
    Yes, in modern browsers that support the EyeDropper API.


📄 License

MIT


🔗 Useful Links


Developed by Mohammadreza Samani