🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

gradient-alpha

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gradient-alpha

```shell npm install gradient-alpha --save ```

0.0.3
latest
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created

Installation

npm install gradient-alpha --save
<script src="js/gradient-alpha.js"></script>

gradient

Features

generate ImageData or Canvas from Image or ImageData by alpha options; 生成新的渐变透明度图片或ImageData.

Methonds

linear:

 gradient.linear< T extends HTMLImageElement|ImageData>(img:T, angel: number = 90, stops: number[] | Array<[number, number | string]> = [0, 1],alphas?:number[]):T

img - ImageData|HTMLImageElement;

angel - number;gradient direction,range:[0,360];

stops - [[number,number|string]...];alpha sections;like [[0,"0"],[1:"100%"]];frist param is alpha,second param is length(range[0,1] or range["0","100%"]);

example:

gradient.linear(new Image(),45,[[0,"0"],[0.3,"50%"],[1,"100%"]])

FAQs

Package last updated on 26 Jan 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