diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index c8208ced..24d569e9 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -6463,8 +6463,8 @@ var thegrid = (function () { '
' + '' + '' + + (isdir ? 'folder' : 'file') + '-icon" color="' + + (ext == 'unk' || ext.startsWith('/') ? '#0000' : intToHSL(hashCode(ext))) + '"/>' + (isdir || ext == 'unk' || ext.startsWith('/') ? '' : '' + ext + '') + @@ -6512,16 +6512,12 @@ var thegrid = (function () { function hashCode (str) { var hash = 0; for(var i = 0; i < str.length; i++){ - hash = str.charCodeAt(i) + 2026 * ((hash << 5) - hash); + hash = str.charCodeAt(i) + 130 * ((hash << 5) - hash); } return hash } - function intToRGB(i){ - var c = (i & 0x00FFFFFF) - .toString(16) - .toUpperCase(); - - return "00000".substring(0, 6 - c.length) + c; + function intToHSL(i){ + return 'hsl(' + i % 360 + 'deg 100% 50%)' } r.bagit = function (isrc) {