From 877e56d81cd3cbb7885928a391cafc7ab0b66e83 Mon Sep 17 00:00:00 2001 From: shinemoon Date: Fri, 17 Nov 2023 21:27:15 +0800 Subject: [PATCH] var name refine --- xExtension-ColorfulList/static/script.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xExtension-ColorfulList/static/script.js b/xExtension-ColorfulList/static/script.js index c106e01..0363fcf 100644 --- a/xExtension-ColorfulList/static/script.js +++ b/xExtension-ColorfulList/static/script.js @@ -31,10 +31,10 @@ const stringToColour = (str) => { str.split('').forEach(char => { hash = char.charCodeAt(0) + ((hash << 5) - hash) }) - let colour = '#' + let color = '#'; for (let i = 0; i < 3; i++) { const value = (hash >> (i * 8)) & 0xff - colour += value.toString(16).padStart(2, '0') + color += value.toString(16).padStart(2, '0') } - return colour + return color; };