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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@pluginjs/color-selector

v0.8.22

Published

A flexible modern color-selector js plugin.

Downloads

8

Readme

ColorSelector

npm package

A flexible modern color-selector js plugin.

Samples

Introduction

Installation

Yarn

yarn add @pluginjs/color-selector

NPM

npm i @pluginjs/color-selector

Getting Started

CDN:

Development:

<script src="https://unpkg.com/@pluginjs/color-selector/dist/color-selector.js"></script>
<link rel="stylesheet" href="https://unpkg.com/@pluginjs/color-selector/dist/color-selector.css">

Production:

<script src="https://unpkg.com/@pluginjs/color-selector/dist/color-selector.min.js"></script>
<link rel="stylesheet" href="https://unpkg.com/@pluginjs/color-selector/dist/color-selector.min.css">

Initialize

HTML:

<div class="element"></div>

ECMAScript Module:

import ColorSelector from "@pluginjs/color-selector"
import "@pluginjs/color-selector/dist/color-selector.css"

ColorSelector.of(document.querySelector('.element'), options)

CommonJS:

require("@pluginjs/color-selector/dist/color-selector.css")
const ColorSelector = require("@pluginjs/color-selector")

ColorSelector.of(document.querySelector('.element'), options)

Browser:

<link rel="stylesheet" href="https://unpkg.com/@pluginjs/color-selector/dist/color-selector.css">
<script src="https://unpkg.com/@pluginjs/color-selector/dist/color-selector.js"></script>
<script>
  Pj.colorSelector('.element', options)
</script>

API

Options

Options are called on colorSelector instances through the colorSelector options itself. You can also save the instances to variable for further use.

Name | Description | Default --|--|-- "theme" | Set plugin theme option | null "locale" | Set locale environment | en "placeholder" | Set input box prompt information | choose color "module" | Set plugin module option | ["collection","solid","gradient"] "solidMode" | Set plugin solidMode option | full "solidModule" | Set plugin solidModile option | {"saturation":true,"hue":true,"alpha":true,"hex":true} "gradientMode" | Set plugin gradientMode option | linear "defaultColor" | Set plugin defaultColor option | #000 "data" | Set plugin data option | null "color" | Set plugin color option | {"format":false,"alphaConvert":{"RGB":"RGBA","HSL":"HSLA","HEX":"RGBA","NAMESPACE":"RGBA"},"shortenHex":false,"hexUseName":false,"reduceAlpha":true,"nameDegradation":"HEX","invalidValue":"","zeroAlphaAsTransparent":true} "manage" | Set plugin manage option | function() {...} "templates" | Set default templates | {} "process" | The type of object change the type of JSON | function() {...} "parse" | The type of JSON change the type of object | function() {...}

Events

Events are called on colorSelector instances through the colorSelector events itself. You can also save the instances to variable for further use.

Name | Description --|-- "update" | Gets fired when plugin has destroy "ready" | Gets fired when plugin has ready "enable" | Gets fired when plugin has enabled "disable" | Gets fired when plugin has disabled "destroy" | Gets fired when plugin has destroy "change" | Gets fired when plugin has changed "openPanel" | Gets fired when plugin has openPanel "switchModule" | Gets fired when plugin has switchModule

Methods

Methods are called on colorSelector instances through the colorSelector method itself. You can also save the instances to variable for further use.

Name | Description --|-- "enable" | Enabled plugin if plugin is disabled "disable" | Disable plugin "get" | Get value by key "set" | Set value by key "update" | Update plugin

Classes

Name | Description | Default --|| "NAMESPACE" | Declare plugin namespace | pj-colorSelector "THEME" | Declare plugin theme | {namespace}--{theme} "ELEMENT" | Declare plugin element | {namespace} "WRAP" | Declare plugin wrap | {namespace}-wrap "TRIGGER" | Declare plugin trigger | {namespace}-trigger "DISABLED" | Announce plugin is disabled | {namespace}-disabled "INPUT" | Declare plugin input | {namespace}-input "REMOVE" | Declare plugin remove | {namespace}-remove "MASK" | Declare plugin mask | {namespace}-mask "PREVIEW" | Declare plugin preview | {namespace}-preview "PREVIEWCOLOR" | Declare plugin preview color | {namespace}-preview-color "PREVIEWBG" | Declare plugin preview bg | {namespace}-preview-bg "PANEL" | Declare plugin panel | {namespace}-panel "OPENPANEL" | Declare plugin open | {namespace}-open "PANELWRAP" | Declare plugin panel wrap | {namespace}-panel-wrap "PANELTRIGGER" | Declare plugin panel trigger | {namespace}-panel-trigger "PANELTRIGGERCOLLECTION" | Declare plugin panel trigger collection | {namespace}-panel-trigger-collection "PANELTRIGGERSOLID" | Declare plugin panel trigger solid | {namespace}-panel-trigger-solid "PANELTRIGGERGRADIENT" | Declare plugin panel trigger gradient | {namespace}-panel-trigger-gradient "PANELCONTAINER" | Declare plugin panel container | {namespace}-panel-container "PANELCOLLECTION" | Declare plugin panel collection | {namespace}-panel-collection "PANELSOLID" | Declare plugin panel solid | {namespace}-panel-solid "PANELGRADIENT" | Declare plugin panel gradient | {namespace}-panel-gradient "SELECTED" | Declare plugin selected | {namespace}-selected "SOLIDHANDLE" | Declare plugin solid handle | {namespace}-solid-handle "SOLIDPRIMARY" | Declare plugin solid primary | {namespace}-solid-primary "SOLIDACTION" | Declare plugin solid action | {namespace}-solid-action "CONTRAST" | Declare plugin contrast | {namespace}-contrast "CONTRASTNOW" | Declare plugin contrast now | {namespace}-contrast-now "CONTRASTPREV" | Declare plugin contrast prev | {namespace}-contrast-prev "HISTORY" | Declare plugin history | {namespace}-history "HISTORYITEM" | Declare plugin history item | {namespace}-history-item "FAVORITES" | Declare plugin favorites | {namespace}-favorites "SCHEME" | Declare plugin scheme | {namespace}-scheme "GROUPTITLE" | Declare plugin group title | {namespace}-group-title "GROUPLIST" | Declare plugin group list | {namespace}-group-list "COLLECTIONITEM" | Declare plugin collection item | {namespace}-collection-item "MANAGE" | Declare plugin manage | {namespace}-manage "COLLECTIONSCROLLWRAP" | Declare plugin collection scroll wrap | {namespace}-collection-scrollwrap "POINTER" | Declare plugin pointer | {namespace}-pointer "ALPHA" | Declare plugin alpha | {namespace}-alpha "HUE" | Declare plugin hue | {namespace}-hue "HEX" | Declare plugin hex | {namespace}-hex "SATURATION" | Declare plugin saturation | {namespace}-saturation "CANCEL" | Announce plugin is cancel | {namespace}-cancel "OK" | Announce plugin is ok | {namespace}-ok "GRADIENTHANDLE" | Declare plugin gradient handle | {namespace}-gradient-handle "GRADIENTPRIMARY" | Declare plugin gradient primary | {namespace}-gradient-primary "GRADIENTACTION" | Declare plugin gradient action | {namespace}-gradient-action "GRADIENTBAR" | Declare plugin gradient bar | {namespace}-gradient-bar "GRADIENTBARVIEW" | Declare plugin gradient bar view | {namespace}-gradient-bar-view "GRADIENTCONTENT" | Declare plugin gradient content | {namespace}-gradient-content "GRADIENTREMOVE" | Declare plugin gradient remove | {namespace}-gradient-remove "GRADIENTREMOVEACTIVE" | Declare plugin gradient remove active | {namespace}-gradient-remove-active "GRADIENTMODE" | Declare plugin gradient mode | {namespace}-gradient-mode "MARKER" | Declare plugin marker | {namespace}-marker "MARKERACTIVE" | Declare plugin marker active | {namespace}-marker-active "WHEEL" | Declare plugin wheel | {namespace}-wheel "WHEELHANDLE" | Declare plugin wheel handle | {namespace}-wheel-handle "WHEELANGLE" | Declare plugin wheel angle | {namespace}-wheel-angle

Translations

Name | EN | ZH --||- "ok" | ok | 保存 "cancel" | Cancel | 取消 "manage" | Manage | 管理 "collection" | Collection | 收藏 "solid" | Solid | 纯色 "gradient" | Gradient | 渐变 "colorInScheme" | COLORS IN SCHEME | 颜色格式 "myColors" | MY COLORS | 我的颜色

Browser support

Tested on all major browsers.

| IE / Edge | Firefox | Chrome | Safari | Opera | | --------- | --------- | --------- | --------- | --------- | | IE11, Edge| last 2 versions| last 2 versions| last 2 versions| last 2 versions|

License

@pluginjs/color-selector is Licensed under the GPL-v3 license.

If you want to use @pluginjs/color-selector project to develop commercial sites, themes, projects, and applications, the Commercial license is the appropriate license. With this option, your source code is kept proprietary.

For purchase an Commercial License, contact us [email protected].

Copyright

Copyright (C) 2022 Creation Studio Limited.