color-picker-temperature
TypeScript icon, indicating that this package has built-in type declarations

0.1.9 • Public • Published

Color Picker Temperature

Kelvin

Installing

npm

npm i color-picker-temperature

yarn

yarn color-picker-temperature

pnpm

pnpm color-picker-temperature

Usage


instance - selector id or class  (required)

optionsCanvas : {
  width:number|string;  (required) if string '100px' or '100%'
  height:number|string;  (required) if string '100px' or '100%'
  rgbColor?:string; color that need set
  kelvinStart?:number; from 1000
  kelvinEnd?:number;   to 40000
}

rgbColor:string; color that need set

### Methods ColorTemperature

cretate - create your own instance

getColor => getColor(callback)

destroyed - deletes a component

Example

import { ColorTemperature } from "color-picker-temperature";

function getColor(color) {
  console.log(color);
}
const instance = "#dd";
const optionsCanvas = {
  width: "100%",
  height: 100,
  kelvinStart: 1000,
  kelvinEnd: 40000,
  rgbColor: "rgb(255, 246, 247)",
};

const colorTemperature = new ColorTemperature();
colorTemperature.create(instance, optionsCanvas);
colorTemperature.getColor(getColor);

setTimeout(() => {
  // if you need to delete a component
  colorTemperature.destroyed();
}, 10000);

Package Sidebar

Install

npm i color-picker-temperature

Weekly Downloads

2

Version

0.1.9

License

MIT

Unpacked Size

22.6 kB

Total Files

45

Last publish

Collaborators

  • evilel