New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@gradient-js/core

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gradient-js/core

Gradient-js core module

  • 1.1.4
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-60%
Maintainers
1
Weekly downloads
 
Created
Source

@gradient-js/core

gradient-js module for raw (object) gradient output generation

License: MIT

Installation

CLI

Yarn
yarn add @gradient-js/core
Npm
npm install --save @gradient-js/core

CDN

<script src="https://unpkg.com/gradient-js/core@x.x.x/core.js">

Usage

import { Core } from '@gradient-js/core';

const core = new Core();
const gradient = core.get(colors, options);

Inputs

In order to create a gradient you will need to pass an array of colors and an options object to the Core's get method. colors should be an array of strings in any valid css format (rgb(a), hex or hsl(a)). options object consists of following properties:

type CoreOptions = {
  useBezier: boolean;
  interpolation: InterpolationMode;
  samples: number;
  lightnessCorrection: boolean;
};

Where each property can be described as it follows:

OptionTypeDescription
useBezierbooleanDecide whether to use chroma's scale() with bezier interpolation
interpolationchroma.InterpolationModeColor interpolation space, one of:
`"rgb"
samplesnumberAmount of gradient parts in the output
lightnessCorrectionbooleanDecide whether to apply lightness correction to your gradient.

Core's get method will generate an array of chroma.Color objects.

Keywords

FAQs

Package last updated on 01 Aug 2020

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