mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-23 07:10:41 +00:00
Format
This commit is contained in:
@@ -52,16 +52,16 @@ export function generateColor() {
|
||||
}
|
||||
|
||||
function intToUnsigned(n: number) {
|
||||
n |= 0; // Force to signed 32-bit integer
|
||||
return n < 0 ? n + 0x100000000 : n;
|
||||
n |= 0 // Force to signed 32-bit integer
|
||||
return n < 0 ? n + 0x100000000 : n
|
||||
}
|
||||
|
||||
export function intToHexRgb(c: number | undefined) {
|
||||
return c ? '#' + (c & 0xFFFFFF).toString(16).padStart(6, '0') : '#000000';
|
||||
return c ? '#' + (c & 0xFFFFFF).toString(16).padStart(6, '0') : '#000000'
|
||||
}
|
||||
|
||||
export function intToDisplayHexRgb(c: number | undefined) {
|
||||
return c ? '#' + intToUnsigned(c).toString(16).toUpperCase().padStart(6, '0') : '#000000';
|
||||
return c ? '#' + intToUnsigned(c).toString(16).toUpperCase().padStart(6, '0') : '#000000'
|
||||
}
|
||||
|
||||
export function htmlEncode(str: string) {
|
||||
|
||||
Reference in New Issue
Block a user