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

tinygradient

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tinygradient

Fast and small gradients manipulation, built on top of TinyColor

  • 1.1.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
575K
increased by8.03%
Maintainers
1
Weekly downloads
 
Created

What is tinygradient?

The tinygradient npm package is a lightweight library for creating and manipulating gradients. It allows you to generate gradients with multiple colors, interpolate colors, and convert gradients to different formats.

What are tinygradient's main functionalities?

Creating a Gradient

This feature allows you to create a gradient by specifying an array of color stops. The example creates a gradient from red to green to blue.

const tinygradient = require('tinygradient');
const gradient = tinygradient(['#ff0000', '#00ff00', '#0000ff']);
console.log(gradient);

Getting Colors from a Gradient

This feature allows you to get an array of colors from the gradient. The example gets 10 colors from the gradient.

const tinygradient = require('tinygradient');
const gradient = tinygradient(['#ff0000', '#00ff00', '#0000ff']);
const colors = gradient.rgb(10);
console.log(colors);

Converting Gradient to CSS

This feature allows you to convert the gradient to a CSS gradient string. The example converts the gradient to a linear gradient going to the right.

const tinygradient = require('tinygradient');
const gradient = tinygradient(['#ff0000', '#00ff00', '#0000ff']);
const cssGradient = gradient.css('linear', 'to right');
console.log(cssGradient);

Other packages similar to tinygradient

Keywords

FAQs

Package last updated on 05 Jun 2021

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