UNPKG

soccer-jersey-fixed

Version:

Generate soccer jerseys in SVG format. Fork of the original soccer-jersey package, so that @svgdotjs/svg.js dependency is retrieved from npmjs rather than github

34 lines (33 loc) 2 kB
import { DrawSoccerJerseyProps } from '../types'; /** * * @param {object} specs Specifications of the soccer jersey. * @param {string} specs.shirtText The text to be displayed on the shirt. * Recommended 3 letter team initials * @param {string} specs.textColor The color (HTML Color Code) for the * text displayed on the shirt * @param {string} specs.textOutlineColor Optional. The outline color (HTML Color Code) for the * text displayed on the shirt * @param {string} specs.textBackgroundColor Optional. The background color (HTML Color Code) for the * text displayed on the shirt * @param {string} specs.shirtColor The main color (HTML Color Code) of * the shirt. * @param {string} specs.sleeveColor The color (HTML Color Code) of the shirt * sleeves; * @param {string} specs.shirtStyle The Style of the shirt (torso region). * Supports "plain", "two-color", "striped", "striped-thin","striped-thick","checkered", * "hoops","single-band", "waves", "dashed"; * @param {string} specs.shirtStyleColor The color (HTML Color Code) of * used for the shirt style. * @param {string} specs.shirtStyleDirection The style of the single band. * Required when using the "single-band" shirt style. Supports * "diagonal-right", "diagonal-left","horizontal", "vertical" * @param {boolean} specs.isBack Set to true to draw the shirt from the * back (different neck shape, no badges). Defaults to false. * @param {boolean} encodeToDataUri By default soccer jersey will return a Data URI * string like data:image/svg+xml;base64,...... You can set false, to return the actual * SVG contents as a string. * @return {string} A data URL ready for direct use as src attribute * on <img /> */ export default function drawSoccerJersey({ shirtText, textColor, textOutlineColor, textBackgroundColor, shirtColor, sleeveColor, shirtStyle, shirtStyleColor, shirtStyleDirection, isBack, }: DrawSoccerJerseyProps, encodeToDataUri?: boolean): string;