fixed bugs in tags editing
This commit is contained in:
@@ -50,6 +50,10 @@ function stringToColorHash(value) {
|
||||
}
|
||||
|
||||
// Converts user or topic ID to a CSS color class. Ideally it should produce the same color value as Java version.
|
||||
export function idToColorClass(string, light) {
|
||||
return (light ? 'light-color' : 'dark-color') + (Math.abs(stringToColorHash(string)) % 16);
|
||||
// params:
|
||||
// - {string} id: user or topic ID
|
||||
// - {boolean} light: light or dark version of the color.
|
||||
// - {boolean} fg: foreground or background color.
|
||||
export function idToColorClass(id, light, fg) {
|
||||
return (light ? 'lt-' : 'dk-') + (fg ? 'fg-' : 'bg-') + (Math.abs(stringToColorHash(id)) % 16);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user