Socket
Book a DemoInstallSign in
Socket

color-token

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

color-token

simple tonal palettes generator with javascript

1.1.3
unpublished
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

color-token

simple tonal palettes generator with javascript

How to use

import { createTonalPalettes } from "color-token";

const colorPalette = createTonalPalettes("gray", "#cdcdcd");

console.log(colorPalette.gray500);

image

Utils

Color Picker

  • brightness

    use Color Model YUV

    import { ColorPicker } from "color-token";
    console.log(ColorPicker.brightness("#3f2ed2")); // 75.955
    
  • luminance

    use Color Model YIQ

    import { ColorPicker } from "color-token";
    console.log(ColorPicker.luminance("#3f2ed2")); // 69.779
    
  • saturation

    use Color Model HSL

    import { ColorPicker } from "color-token";
    console.log(ColorPicker.saturation("#3f2ed2")); // 0.6456692913385826
    

Color Adjustment

  • opacity

    import { ColorAdjustment } from "color-token";
    console.log(ColorAdjustment.opacity("#3f2ed2", 0.5));
    
  • brightness

    import { ColorAdjustment } from "color-token";
    console.log(ColorAdjustment.brightness("#3f2ed2", -0.2));
    
  • blendColors

    import { ColorAdjustment } from "color-token";
    console.log(ColorAdjustment.blendColors("#3f2ed2", "#a1fe23", 0.4));
    
  • gray

    import { ColorAdjustment } from "color-token";
    console.log(ColorAdjustment.gray("#3f2ed2"));
    

Support Color Model

  • rgb
  • hex
  • hsl
  • lab
  • cmyk
  • yiq
  • yuv
  • yCbCr

FAQs

Package last updated on 07 Mar 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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.