Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

use slice instead of substring for desired result

Sergio Mensinge8a30e7251fd
diff --git a/lib/format.js b/lib/format.js
index a85c3ef76..e138831dc 100644
--- a/lib/format.js
+++ b/lib/format.js
@@ -74,7 +74,7 @@ export function stringToColor(str) {
let color = '#';
for (let i = 0; i < 3; i++) {
let value = (hash >> (i * 8)) & 0xff;
- color += ('00' + value.toString(16)).substring(-2);
+ color += ('00' + value.toString(16)).slice(-2);
}
return color;
}