Skip to content

Commit d2a5bf9

Browse files
author
LashaKakabadze
committed
Fixed #4
1 parent e9a044b commit d2a5bf9

File tree

3 files changed

+27
-16
lines changed

3 files changed

+27
-16
lines changed

README.md

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
11
## javascript-color-gradient
2+
23
![MIT License](https://img.shields.io/npm/l/javascript-color-gradient)
4+
![Version](https://img.shields.io/github/package-json/v/adrinlol/javascript-color-gradient)
5+
![Issue tracking](https://img.shields.io/github/issues-raw/adrinlol/javascript-color-gradient)
36
![GitHub stars](https://img.shields.io/github/stars/Adrinlol/javascript-color-gradient?style=social)
4-
![Bundle size](https://img.shields.io/bundlephobia/min/javascript-color-gradient?style=flat-square)
5-
67

78
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.
89

10+
## Demo
11+
12+
https://codesandbox.io/s/javascript-color-gradient-csgfd
13+
914
## Installation
15+
1016
```bash
1117
npm install javascript-color-gradient
1218
```
1319

1420
## Usage
21+
1522
```javascript
1623
import Gradient from "javascript-color-gradient";
1724

@@ -22,30 +29,34 @@ const color2 = "#8BC2E3";
2229

2330
colorGradient.setGradient(color1, color2);
2431
```
32+
2533
## Methods
2634

27-
#### setGradient(color1, color2) - sets two or more hex color values. Should always be defined.
35+
##### setGradient(color1, color2) - sets two or more hex color values. Should always be defined.
2836

29-
#### setMidpoint(n) - sets the number range to n. By default n is 10.
37+
##### setMidpoint(n) - sets the number range to n. By default n is 10.
3038

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

33-
#### getColor(n) - returns certain hex color, where n is a requested number of midpoint colors.
41+
##### getColor(n) - returns certain hex color, where n is a requested number of midpoint colors.
3442

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

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

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

4554
## Contributing
55+
4656
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
4757

4858
Please make sure to update tests as appropriate.
4959

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

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "javascript-color-gradient",
3-
"version": "1.2.2",
3+
"version": "1.2.4",
44
"description": "javascript-color-gradient is a 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. ",
55
"main": "dist/index.js",
66
"scripts": {
@@ -16,13 +16,13 @@
1616
"url": "https://github.com/Adrinlol/javascript-color-gradient.git"
1717
},
1818
"keywords": [
19-
"color",
20-
"colour",
21-
"palette",
19+
"javascript-color-palette",
20+
"color-gradient",
21+
"react-palette",
2222
"color-picker",
2323
"color-wavelengths"
2424
],
25-
"author": "Lasha Kakabadze <l.qqbadze@gmail.com> (https://zenn.ge/)",
25+
"author": "Lasha Kakabadze <l.qqbadze@gmail.com>",
2626
"license": "MIT",
2727
"bugs": {
2828
"url": "https://github.com/Adrinlol/javascript-color-gradient/issues"

0 commit comments

Comments
 (0)