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 f (width, height, color1, color2) {
|
17 | let lineWidth = numcal.min(width, height) * 0.05
|
18 | let r = numcal.min(height, width) * 0.2
|
19 |
|
20 | return _svg(width, height, {
|
21 | rect: [
|
22 | {
|
23 | '@': {
|
24 | x: lineWidth / 2,
|
25 | y: lineWidth / 2,
|
26 | width: width - lineWidth,
|
27 | height: height - lineWidth,
|
28 | rx: r,
|
29 | ry: r,
|
30 | fill: color2
|
31 | }
|
32 | },
|
33 | {
|
34 | '@': {
|
35 | x: lineWidth / 2,
|
36 | y: lineWidth / 2,
|
37 | width: width - lineWidth,
|
38 | height: height - lineWidth,
|
39 | rx: r,
|
40 | ry: r,
|
41 | fill: 'none',
|
42 | 'stroke-width': lineWidth,
|
43 | stroke: color1
|
44 | }
|
45 | }
|
46 | ]
|
47 | })
|
48 | }
|
49 |
|
50 | f.$reversed = true
|
51 |
|
52 | module.exports = f
|