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 c (width, height, color1, color2) {
|
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 | width: width,
|
26 | height: height,
|
27 | fill: color2
|
28 | }
|
29 | }, {
|
30 | '@': {
|
31 | x: lineWidth / 2,
|
32 | y: lineWidth / 2,
|
33 | width: width - lineWidth,
|
34 | height: height - lineWidth,
|
35 | fill: 'none',
|
36 | 'stroke-width': lineWidth,
|
37 | stroke: color1
|
38 | }
|
39 | }
|
40 | ]
|
41 | })
|
42 | }
|
43 |
|
44 | c.$reversed = true
|
45 |
|
46 | module.exports = c
|