-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtest.js
More file actions
32 lines (29 loc) · 752 Bytes
/
test.js
File metadata and controls
32 lines (29 loc) · 752 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import colourPalette from './'
console.log('测试通过:', colourPalette('#108ee9', 1) == '#ecf6fd')
console.log(colourPalette)
// $blue-6 = #108ee9;
// $purple-6 = #7265e6;
// $cyan-6 = #00a2ae;
// $green-6 = #00a854;
// $pink-6 = #f5317f;
// $red-6 = #f04134;
// $orange-6 = #f56a00;
// $yellow-6 = #ffbf00;
/* eslint key-spacing: 0 */
const colors = {
blue : '#108ee9',
purple : '#7265e6',
cyan : '#00a2ae',
green : '#00a854',
pink : '#f5317f',
red : '#f04134',
orange : '#f56a00',
yellow : '#ffbf00',
}
var colorResult = {}
Object.keys(colors).forEach((key) => {
for (let i = 1; i < 11; i++) {
colorResult[`$${key}-${i}`] = colourPalette(colors[key], i)
}
})
console.log(colorResult)