svg2canvas
Advanced tools
Comparing version 0.0.10 to 0.0.11
@@ -7,2 +7,3 @@ export declare type Color = { | ||
export declare function parseColor(col: string): Color; | ||
export declare function ColorToHex(col: Color): string; | ||
export declare function blend({ r: r1, g: g1, b: b1 }: Color, { r: r2, g: g2, b: b2 }: Color, a: number): Color; | ||
@@ -9,0 +10,0 @@ declare type Style = { |
@@ -0,1 +1,2 @@ | ||
"use strict"; | ||
var __assign = (this && this.__assign) || function () { | ||
@@ -19,3 +20,5 @@ __assign = Object.assign || function(t) { | ||
}; | ||
export function parseColor(col) { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.CreateDrawingFromSVG = exports.SVGDrawing = exports.Drawing = exports.blend = exports.ColorToHex = exports.parseColor = void 0; | ||
function parseColor(col) { | ||
var is6DigitHex = /^\#(?:[0-9A-F]{6})$/i; | ||
@@ -30,3 +33,11 @@ if (!is6DigitHex.test(col)) | ||
} | ||
export function blend(_a, _b, a) { | ||
exports.parseColor = parseColor; | ||
function ColorToHex(col) { | ||
return "#" + [col.r, col.g, col.b].map(function (x) { | ||
var hex = Math.round(x).toString(16); | ||
return (hex.length === 1 ? '0' + hex : hex); | ||
}).join(''); | ||
} | ||
exports.ColorToHex = ColorToHex; | ||
function blend(_a, _b, a) { | ||
var r1 = _a.r, g1 = _a.g, b1 = _a.b; | ||
@@ -40,2 +51,3 @@ var r2 = _b.r, g2 = _b.g, b2 = _b.b; | ||
} | ||
exports.blend = blend; | ||
var StyleNames = [ | ||
@@ -202,3 +214,3 @@ ["fillStyle", "fill", "black"], | ||
}()); | ||
export { Drawing }; | ||
exports.Drawing = Drawing; | ||
var SVGDrawing = /** @class */ (function () { | ||
@@ -231,3 +243,3 @@ function SVGDrawing(width, height) { | ||
}()); | ||
export { SVGDrawing }; | ||
exports.SVGDrawing = SVGDrawing; | ||
var Shapes = { | ||
@@ -310,3 +322,3 @@ "rect": { | ||
}; | ||
export function CreateDrawingFromSVG(svg, globalStyle) { | ||
function CreateDrawingFromSVG(svg, globalStyle) { | ||
if (!svg) | ||
@@ -374,1 +386,2 @@ return undefined; | ||
} | ||
exports.CreateDrawingFromSVG = CreateDrawingFromSVG; |
{ | ||
"name": "svg2canvas", | ||
"version": "0.0.10", | ||
"version": "0.0.11", | ||
"description": "Library to allow batching and rendering of SVGs onto the canvas EFFICIENTLY. Currently only compatible w/ simple geometry.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
52217
421