soccer-jersey-fork 1.0.62 → 1.0.63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +1,6 @@
1
1
  import { DrawSoccerJerseyProps } from "../types";
2
2
  /**
3
3
  * @param {object} specs Specifications of the soccer jersey.
4
- * @param {string} specs.shirtText The text to be displayed on the shirt.
5
- * Recommended 3 letter team initials
6
- * @param {string} specs.textColor The color (HTML Color Code) for the
7
- * text displayed on the shirt
8
- * @param {string} specs.textOutlineColor Optional. The outline color (HTML Color Code) for the
9
- * text displayed on the shirt
10
- * @param {string} specs.textBackgroundColor Optional. The background color (HTML Color Code) for the
11
- * text displayed on the shirt
12
4
  * @param {string} specs.shirtColor The main color (HTML Color Code) of
13
5
  * the shirt.
14
6
  * @param {string} specs.sleeveColor The color (HTML Color Code) of the shirt
@@ -10,14 +10,6 @@ import lightenDarkenColor from "./lighten-darken-color";
10
10
  import { drawSingleBand, drawCheckered, drawTwoColors, drawWaves, drawDashes, addShoulderSideColor, addShortSideColor, addShirtSideColor, drawSingleBandThin, drawDiamonds, drawStripedThin, drawStripedNormal, drawStripedThick, } from "../patterns/patterns";
11
11
  /**
12
12
  * @param {object} specs Specifications of the soccer jersey.
13
- * @param {string} specs.shirtText The text to be displayed on the shirt.
14
- * Recommended 3 letter team initials
15
- * @param {string} specs.textColor The color (HTML Color Code) for the
16
- * text displayed on the shirt
17
- * @param {string} specs.textOutlineColor Optional. The outline color (HTML Color Code) for the
18
- * text displayed on the shirt
19
- * @param {string} specs.textBackgroundColor Optional. The background color (HTML Color Code) for the
20
- * text displayed on the shirt
21
13
  * @param {string} specs.shirtColor The main color (HTML Color Code) of
22
14
  * the shirt.
23
15
  * @param {string} specs.sleeveColor The color (HTML Color Code) of the shirt
@@ -154,21 +146,22 @@ export default function drawSoccerJersey({ shirtColor = "plain", sleeveColor, sh
154
146
  for (const textItem of texts) {
155
147
  const { text, color, size, outlineColor, backgroundColor, x, y } = textItem;
156
148
  const drawText = (elem) => {
157
- return elem
149
+ const elemClone = elem
158
150
  .text(text)
159
151
  .fill(lightenDarkenColor(color ? color : "#fff", -50))
160
152
  .font({
161
153
  family: "Monospace",
162
154
  size,
163
155
  style: "bold",
164
- })
165
- .stroke({
166
- color: outlineColor
167
- ? outlineColor
168
- : lightenDarkenColor(color ? color : "#fff", 10),
169
- width: 0.5,
170
156
  })
171
157
  .center(x, y);
158
+ if (outlineColor) {
159
+ elemClone.stroke({
160
+ color: outlineColor,
161
+ width: 0.5,
162
+ });
163
+ }
164
+ return elemClone;
172
165
  };
173
166
  if (backgroundColor) {
174
167
  // eslint-disable-next-line new-cap
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "soccer-jersey-fork",
3
- "version": "1.0.62",
3
+ "version": "1.0.63",
4
4
  "description": "Generate soccer jerseys in SVG format",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {