generate-avatar
Advanced tools
Comparing version 1.3.1 to 1.4.0
@@ -11,2 +11,9 @@ "use strict"; | ||
var md5hash_1 = require("./md5hash"); | ||
function hexToRgb(hex) { | ||
var bigint = parseInt(hex, 16); | ||
var r = (bigint >> 16) & 255; | ||
var g = (bigint >> 8) & 255; | ||
var b = bigint & 255; | ||
return r + "," + g + "," + b; | ||
} | ||
function invertHex(hex) { | ||
@@ -24,3 +31,3 @@ return (Number("0x1" + hex) ^ 0xffffff).toString(16).substr(1).toUpperCase(); | ||
function hydrateSVGBlog(data) { | ||
var svgString = "<svg width=\"300\" height=\"300\" viewBox=\"0 0 300 300\" xmlns=\"http://www.w3.org/2000/svg\"><rect id=\"bg\" width=\"300\" height=\"300\" fill=\"#" + data.background + "\" /><path d=\"" + data.paths[0] + "\" fill=\"#" + data.colors[0] + "\" /><path d=\"" + data.paths[1] + "\" fill=\"#" + data.colors[1] + "\" /><path d=\"" + data.paths[2] + "\" fill=\"#" + data.colors[2] + "\" /></svg>"; | ||
var svgString = "<svg width=\"300\" height=\"300\" viewBox=\"0 0 300 300\" xmlns=\"http://www.w3.org/2000/svg\"><rect id=\"bg\" width=\"300\" height=\"300\" fill=\"rgb(" + hexToRgb(data.background) + ")\" /><path d=\"" + data.paths[0] + "\" fill=\"rgb(" + hexToRgb(data.colors[0]) + ")\" /><path d=\"" + data.paths[1] + "\" fill=\"rgb(" + hexToRgb(data.colors[1]) + ")\" /><path d=\"" + data.paths[2] + "\" fill=\"rgb(" + hexToRgb(data.colors[2]) + ")\" /></svg>"; | ||
return svgString; | ||
@@ -27,0 +34,0 @@ } |
{ | ||
"name": "generate-avatar", | ||
"version": "1.3.1", | ||
"version": "1.4.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
275
49706