1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | 'use strict'
|
11 |
|
12 | const _svg = require('./_svg')
|
13 | const numcal = require('numcal')
|
14 |
|
15 |
|
16 | function d (width, height, color1, color2) {
|
17 | let r = numcal.min(height, width) * 0.1
|
18 |
|
19 | return _svg(width, height, {
|
20 | rect: [
|
21 | {
|
22 | '@': {
|
23 | x: 0,
|
24 | y: 0,
|
25 | rx: r,
|
26 | ry: r,
|
27 | width: width,
|
28 | height: height,
|
29 | fill: color2
|
30 | }
|
31 | },
|
32 | {
|
33 | '@': {
|
34 | x: 0,
|
35 | y: 0,
|
36 | rx: r,
|
37 | ry: r,
|
38 | width: width,
|
39 | height: height,
|
40 | fill: color1
|
41 | }
|
42 | }
|
43 | ]
|
44 | })
|
45 | }
|
46 |
|
47 | d.$reversed = false
|
48 |
|
49 | module.exports = d
|