1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | const _svg = require('./_svg')
|
12 | const numcal = require('numcal')
|
13 |
|
14 |
|
15 | function i (width, height, color1, color2) {
|
16 | let r = numcal.min(height, width)
|
17 | let lineWidth = numcal.min(width, height) * 0.05
|
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: lineWidth / 2,
|
35 | y: lineWidth / 2,
|
36 | rx: r,
|
37 | ry: r,
|
38 | width: width - lineWidth,
|
39 | height: height - lineWidth,
|
40 | fill: 'none',
|
41 | 'stroke-width': lineWidth,
|
42 | stroke: color1
|
43 | }
|
44 | }
|
45 | ]
|
46 | })
|
47 | }
|
48 |
|
49 | i.$reversed = true
|
50 |
|
51 | module.exports = i
|