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

@gradient-js/svg

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/svg

Gradient-js svg generation module

  • 1.1.4
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@gradient-js/svg

gradient-js module for svg gradient generation

License: MIT

Installation

CLI

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

CDN

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

Usage

import { Svg } from '@gradient-js/svg';

const svg = new Svg();
const gradient = svg.get(colors, config);

Inputs

In order to create a gradient you will need to pass an array of colors and an options object to the Svg'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 the CoreOptions and following properties:

type SvgOptions = CoreOptions & {
  id: string;
  type: 'linear' | 'radial';
  gradientUnits?: 'objectBoundingBox' | 'userSpaceOnUse';
  linearOptions?: SvgLinearGradientOptions;
  radialOptions?: SvgRadialGradientOptions;
};

SvgLinearGradientOptions

type SvgLinearGradientOptions = {
  angle: number;
  x1: number;
  y1: number;
  x2: number;
  y2: number;
};

Attributes description here

SvgRadialGradientOptions

type SvgRadialGradientOptions = {
  cx: number;
  cy: number;
  r: number;
  fx: number;
  fy: number;
  spreadMethod: 'pad' | 'repeat' | 'reflect';
};

Attributes description here

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