You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lightweight JavaScript library, used to generate an array of color gradients by providing start and finish colors, as well as the required number of midpoints.
8
8
9
+
## Demo
10
+
11
+
https://codesandbox.io/s/sharp-benz-csgfd
12
+
9
13
## Installation
14
+
10
15
```bash
11
16
npm install javascript-color-gradient
12
17
```
13
18
14
19
## Usage
20
+
15
21
```javascript
16
22
importGradientfrom"javascript-color-gradient";
17
23
@@ -22,30 +28,34 @@ const color2 = "#8BC2E3";
22
28
23
29
colorGradient.setGradient(color1, color2);
24
30
```
31
+
25
32
## Methods
26
33
27
-
#### setGradient(color1, color2) - sets two or more hex color values. Should always be defined.
34
+
#####setGradient(color1, color2) - sets two or more hex color values. Should always be defined.
28
35
29
-
#### setMidpoint(n) - sets the number range to n. By default n is 10.
36
+
#####setMidpoint(n) - sets the number range to n. By default n is 10.
30
37
31
-
#### getArray() - returns an array of hex colors. Requires no parameters.
38
+
#####getArray() - returns an array of hex colors. Requires no parameters.
32
39
33
-
#### getColor(n) - returns certain hex color, where n is a requested number of midpoint colors.
40
+
#####getColor(n) - returns certain hex color, where n is a requested number of midpoint colors.
0 commit comments