Skip to content

Commit 1cef398

Browse files
authored
Minor fixups (#2)
* chmod -x LICENSE.md package.json * tabs -> spaces
1 parent 95013a2 commit 1cef398

File tree

4 files changed

+30
-16
lines changed

4 files changed

+30
-16
lines changed

.pre-commit-config.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v1.4.0
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: check-yaml
8+
- repo: local
9+
hooks:
10+
- id: no-tabs
11+
name: no tabs
12+
language: pygrep
13+
entry: '\t'
14+
types: [text]

LICENSE.md

100755100644
File mode changed.

package.json

100755100644
File mode changed.

src/generate.js

+16-16
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ import bezier from 'bezier-easing'
44

55
function distribute(value, rangeA, rangeB) {
66

7-
const [fromLow, fromHigh] = Array.from(rangeA)
8-
const [toLow, toHigh] = Array.from(rangeB)
7+
const [fromLow, fromHigh] = Array.from(rangeA)
8+
const [toLow, toHigh] = Array.from(rangeB)
99

10-
const result = toLow + (((value - fromLow) / (fromHigh - fromLow)) * (toHigh - toLow));
10+
const result = toLow + (((value - fromLow) / (fromHigh - fromLow)) * (toHigh - toLow));
1111

12-
if (toLow < toHigh) {
13-
if (result < toLow) { return toLow }
14-
if (result > toHigh) { return toHigh }
15-
} else {
16-
if (result > toLow) { return toLow }
17-
if (result < toHigh) { return toHigh }
18-
}
12+
if (toLow < toHigh) {
13+
if (result < toLow) { return toLow }
14+
if (result > toHigh) { return toHigh }
15+
} else {
16+
if (result > toLow) { return toLow }
17+
if (result < toHigh) { return toHigh }
18+
}
1919

20-
return result;
20+
return result;
2121
}
2222

2323
export default function({specs}) {
@@ -33,9 +33,9 @@ export default function({specs}) {
3333
return array
3434
}
3535

36-
var lum_array = generateNumberOfSteps(Curves[specs.lum_curve], specs.steps)
37-
var sat_array = generateNumberOfSteps(Curves[specs.sat_curve], specs.steps)
38-
var hue_array = generateNumberOfSteps(Curves[specs.hue_curve], specs.steps)
36+
var lum_array = generateNumberOfSteps(Curves[specs.lum_curve], specs.steps)
37+
var sat_array = generateNumberOfSteps(Curves[specs.sat_curve], specs.steps)
38+
var hue_array = generateNumberOfSteps(Curves[specs.hue_curve], specs.steps)
3939
var lum_array_adjusted = []
4040
var sat_array_adjusted = []
4141
var hue_array_adjusted = []
@@ -96,15 +96,15 @@ export default function({specs}) {
9696
lum: chroma(hex).hsv()[2],
9797
hsv: chroma(hex).hsv(),
9898
hsl: chroma(hex).hsl(),
99-
rgb: chroma(hex).rgb(),
99+
rgb: chroma(hex).rgb(),
100100
hueRange: [specs.hue_start, specs.hue_end],
101101
steps:specs.steps,
102102
label:specs.modifier * index,
103103
contrastBlack:contrastBlack,
104104
contrastWhite:contrastWhite,
105105
displayColor:displayColor,
106106
}
107-
colorMap.push(colorObj)
107+
colorMap.push(colorObj)
108108
}
109109

110110
return colorMap

0 commit comments

Comments
 (0)