Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dls-color-palette

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dls-color-palette

Color palette generator for Baidu Light DLS.

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
24
increased by200%
Maintainers
2
Weekly downloads
 
Created
Source

dls-color-palette

To generate a color palette out of the given base color.

Installation

npm i --save-dev dls-color-palette

Usage

Get color shade

function getShade(color: string, level: number): string

Params:

  • color: string - the brand color in hex format.
  • level: number - level of the color shade. Valid range: [1, 10]

Return Value:

  • Color of the given level in hex format.
import { getShade } from 'dls-color-palette'
const shade = getShade('#0052cc', 2) // → #e0edff

Get contextual color according to the given brand color

function getContextual(color: string, type: string): string

Params:

  • color: string - the brand color in hex format.
  • type: 'info' | 'success' | 'warning' | 'error' - type of the contextual color.

Return Value:

  • Contextual color in hex format.
import { getContextual } from 'dls-color-palette'
const contextual = getContextual('#0052cc', 'success') // → #00bf5c

Keywords

FAQs

Package last updated on 20 Apr 2023

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc