mirror of
https://github.com/thelounge/thelounge.git
synced 2024-06-10 17:52:25 +02:00
c87d82dc48
These colors were built using the current generation function to have similar style.
14 lines
285 B
JavaScript
14 lines
285 B
JavaScript
"use strict";
|
|
|
|
Handlebars.registerHelper(
|
|
// Generates a string from "color-1" to "color-64" based on an input string
|
|
"colorClass", function(str) {
|
|
var hash = 0;
|
|
for (var i = 0; i < str.length; i++) {
|
|
hash += str.charCodeAt(i);
|
|
}
|
|
|
|
return "color-" + (1 + hash % 64);
|
|
}
|
|
);
|