Compare commits

...
1 Commits
Author SHA1 Message Date
TrèsAbhi 92e35bd0ac feat: 1.13.2 2023-10-05 11:04:46 -05:00
5 changed files with 13 additions and 27 deletions

No files matched your search

+3 -1
View File
@@ -1,4 +1,6 @@
# blitzkrieg
# Blitzkrieg
[![built with Codeium](https://codeium.com/badges/main)](https://codeium.com)
Tools for everything World of Tanks Blitz
+7
View File
@@ -0,0 +1,7 @@
# Blitzkrieg 1.13.2
One lonely albeit important fix.
## Fixes
- Gradients for `/stats` now use Radix's new hex values
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "blitzkrieg",
"version": "1.13.1",
"version": "1.13.2",
"description": "🎉 Tools for everything World of Tanks Blitz",
"main": "src/server.ts",
"type": "module",
@@ -1,5 +1,4 @@
import { Percentile } from '../../../../../constants/percentiles';
import hslToHex from '../../../../../core/node/hslToHex';
import { PERCENTILE_COLORS } from '../../../../PercentileIndicator';
export enum GlowSide {
@@ -14,8 +13,8 @@ export interface GlowProps {
export function Glow({ percentile, side }: GlowProps) {
const color = PERCENTILE_COLORS[percentile];
const color1 = hslToHex(color);
const color2 = `${color1}00`;
const color1 = color;
const color2 = `${color}00`;
const background = `linear-gradient(${
side === GlowSide.Top ? 0 : 180
-22
View File
@@ -1,22 +0,0 @@
const numberRegex = /\d+(\.\d+)?/g;
/**
* Thanks to icl7126!
* https://stackoverflow.com/a/44134328/12294756
*/
export default function hslToHex(hsl: string) {
let [h, s, l] = Array.from(hsl.matchAll(numberRegex)).map((m) =>
parseFloat(m[0]),
);
l /= 100;
const a = (s * Math.min(l, 1 - l)) / 100;
const f = (n: number) => {
const k = (n + h / 30) % 12;
const color = l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);
return Math.round(255 * color)
.toString(16)
.padStart(2, '0'); // convert to Hex and prefix "0" if needed
};
return `#${f(0)}${f(8)}${f(4)}`;
}