ssh terminal.shop
function HSLAfromTWcode(twCode: number, hasAlpha?: boolean): [number, number, number, number] {
const hsla: [number, number, number, number] = [0, 0, 0, 255];
if (hasAlpha) {
hsla[3] = (twCode >> 24) & 0xff;
twCode = twCode & 0x00ffffff;
}
hsla[0] = ((twCode >> 16) & 0xff) * (360 / 255);
hsla[1] = ((twCode >> 8) & 0xff) * (100 / 255);
hsla[2] = (twCode & 0xff) * (100 / 255);
hsla[3] /= 255;
return hsla;
}
function HSLAfromTWcode(twCode: number, hasAlpha?: boolean): [number, number, number, number] {
const hsla: [number, number, number, number] = [0, 0, 0, 255];
if (hasAlpha) {
hsla[3] = (twCode >> 24) & 0xff;
twCode = twCode & 0x00ffffff;
}
hsla[0] = ((twCode >> 16) & 0xff) * (360 / 255);
hsla[1] = ((twCode >> 8) & 0xff) * (100 / 255);
hsla[2] = (twCode & 0xff) * (100 / 255);
hsla[3] /= 255;
return hsla;
}
true
whenever im coloring the markingfunction HSLAfromTWcode(twCode: number, hasAlpha?: boolean): [number, number, number, number] {
const hsla: [number, number, number, number] = [0, 0, 0, 255];
if (hasAlpha) {
hsla[3] = (twCode >> 24) & 0xff;
twCode = twCode & 0x00ffffff;
}
hsla[0] = ((twCode >> 16) & 0xff) * (360 / 255);
hsla[1] = ((twCode >> 8) & 0xff) * (100 / 255);
hsla[2] = (twCode & 0xff) * (100 / 255);
hsla[3] /= 255;
return hsla;
}
function HSLToRGB(hsl: [number, number, number]): [number, number, number] {
const [hue, saturation, lightness] = hsl;
const chroma = (1 - Math.abs((2 * lightness) / 100 - 1)) * (saturation / 100);
const huePrime = hue / 60;
const secondComponent = chroma * (1 - Math.abs((huePrime % 2) - 1));
let red = 0;
let green = 0;
let blue = 0;
const flHuePrime = Math.floor(huePrime);
if (flHuePrime === 0) {
red = chroma;
green = secondComponent;
blue = 0;
} else if (flHuePrime === 1) {
red = secondComponent;
green = chroma;
blue = 0;
} else if (flHuePrime === 2) {
red = 0;
green = chroma;
blue = secondComponent;
} else if (flHuePrime === 3) {
red = 0;
green = secondComponent;
blue = chroma;
} else if (flHuePrime === 4) {
red = secondComponent;
green = 0;
blue = chroma;
} else if (flHuePrime === 5) {
red = chroma;
green = 0;
blue = secondComponent;
}
const lightnessAdjustment = lightness / 100 - chroma / 2;
red = Math.round((red + lightnessAdjustment) * 255);
green = Math.round((green + lightnessAdjustment) * 255);
blue = Math.round((blue + lightnessAdjustment) * 255);
return [red, green, blue];
}
[ 290.82352941176475, 61.96078431372549, 14.117647058823529, 1 ]
[ 51, 14, 58 ]
DoButtonLogic
behavior. This is problematic on Android, where the first mouse button is always pressed while the mouse is being moved, causing the seekbar to steal focus immediately whe...