Skip to content

Commit 41be5b7

Browse files
author
LashaKakabadze
committed
Updated README
1 parent e9debf5 commit 41be5b7

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

README.md

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
## javascript-color-gradient
2+
23
![MIT License](https://img.shields.io/npm/l/javascript-color-gradient)
34
![GitHub stars](https://img.shields.io/github/stars/Adrinlol/javascript-color-gradient?style=social)
45
![Bundle size](https://img.shields.io/bundlephobia/min/javascript-color-gradient?style=flat-square)
56

6-
77
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.
88

9+
## Demo
10+
11+
https://codesandbox.io/s/sharp-benz-csgfd
12+
913
## Installation
14+
1015
```bash
1116
npm install javascript-color-gradient
1217
```
1318

1419
## Usage
20+
1521
```javascript
1622
import Gradient from "javascript-color-gradient";
1723

@@ -22,30 +28,34 @@ const color2 = "#8BC2E3";
2228

2329
colorGradient.setGradient(color1, color2);
2430
```
31+
2532
## Methods
2633

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.
2835

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.
3037

31-
#### getArray() - returns an array of hex colors. Requires no parameters.
38+
##### getArray() - returns an array of hex colors. Requires no parameters.
3239

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.
3441

3542
```javascript
36-
console.log(colorGradient.getArray()) // outputs ["#4e4ab9", "#5d68c4", "#6d86ce", "#7ca4d9", "#8bc2e3"]
37-
console.log(colorGradient.getColor(3)) // outputs #6d86ce
43+
console.log(colorGradient.getArray()); // outputs ["#4e4ab9", "#5d68c4", "#6d86ce", "#7ca4d9", "#8bc2e3"]
44+
console.log(colorGradient.getColor(3)); // outputs #6d86ce
3845
```
3946

4047
## Example
41-
Implementing javascript-color-gradient library into React.js application, using two gradient colors and 4 midpoints.
4248

43-
![image](https://user-images.githubusercontent.com/48876996/81550844-e0d7c700-9391-11ea-8222-def50638b326.png)
49+
Implementing javascript-color-gradient library into React.js application, using two gradient colors and 10 midpoints.
50+
51+
![image](https://user-images.githubusercontent.com/48876996/87862417-e1c44080-c960-11ea-817c-b025d8d236ea.PNG)
4452

4553
## Contributing
54+
4655
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
4756

4857
Please make sure to update tests as appropriate.
4958

5059
## License
60+
5161
javascript-color-gradient is [MIT licensed.](https://github.com/Adrinlol/javascript-color-gradient/blob/master/LICENSE)

0 commit comments

Comments
 (0)