Socket
Socket
Sign inDemoInstall

@spectrum-web-components/color-slider

Package Overview
Dependencies
15
Maintainers
7
Versions
162
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @spectrum-web-components/color-slider

An `<sp-color-slider>` lets users visually change an individual channel of a color. The background of the `<sp-color-slider>` is a visual representation of the range of values a user can select from. This can represent color properties such as hues, color


Version published
Weekly downloads
347
decreased by-20.23%
Maintainers
7
Install size
5.72 MB
Created
Weekly downloads
 

Changelog

Source

0.42.2 (2024-04-03)

Note: Version bump only for package @adobe/spectrum-web-components

Readme

Source

Description

An <sp-color-slider> lets users visually change an individual channel of a color. The background of the <sp-color-slider> is a visual representation of the range of values a user can select from. This can represent color properties such as hues, color channel values (such as RGB or CMYK levels), or opacity. Currently, the slider only supports leveraging the hue property.

Usage

See it on NPM! How big is this package in your project? Try it on webcomponents.dev

yarn add @spectrum-web-components/color-slider

Import the side effectful registration of <sp-color-slider> via:

import '@spectrum-web-components/color-slider/sp-color-slider.js';

When looking to leverage the ColorSlider base class as a type and/or for extension purposes, do so via:

import { ColorSlider } from '@spectrum-web-components/color-slider';

Color Formatting

When using the color elements, use el.color to access the color property, which should manage itself in the colour format supplied. If you supply a color in rgb() format, el.color should return the color in rgb() format, as well.

The current color formats supported are as follows:

  • Hex3, Hex4, Hex6, Hex8
  • HSV, HSVA
  • HSL, HSLA
  • RGB, RGBA
  • Strings (eg "red", "blue")

Please note for the following formats: HSV, HSVA, HSL, HSLA When using the HSL or HSV formats, and a color's value (in HSV) is set to 0, or its luminosity (in HSL) is set to 0 or 1, the hue and saturation values may not be preserved by the element's color property. This is detailed in the TinyColor documentation. Seperately, the element's value property is directly managed by the hue as represented in the interface.

Default

<sp-color-slider></sp-color-slider>

Vertical

<sp-color-slider vertical></sp-color-slider>

Disabled

<sp-color-slider disabled></sp-color-slider>

Keywords

FAQs

Last updated on 03 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc