Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/content/Animations/CursorGrid/CursorGrid.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const FALLOFF_CURVES = {
const hexToRgb = hex => {
const h = hex.replace('#', '');
const v = h.length === 3 ? h.split('').map(c => c + c).join('') : h;
const num = parseInt(v, 16);
const num = parseInt(v.slice(0, 6), 16);
return [(num >> 16) & 255, (num >> 8) & 255, num & 255];
};

Expand Down
2 changes: 1 addition & 1 deletion src/content/Animations/LaserFlow/LaserFlow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ export const LaserFlow = ({
.split('')
.map(x => x + x)
.join('');
const n = parseInt(c, 16) || 0xffffff;
const n = parseInt(c.slice(0, 6), 16) || 0xffffff;
return { r: ((n >> 16) & 255) / 255, g: ((n >> 8) & 255) / 255, b: (n & 255) / 255 };
};

Expand Down
2 changes: 1 addition & 1 deletion src/content/Backgrounds/FaultyTerminal/FaultyTerminal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ function hexToRgb(hex) {
.split('')
.map(c => c + c)
.join('');
const num = parseInt(h, 16);
const num = parseInt(h.slice(0, 6), 16);
return [((num >> 16) & 255) / 255, ((num >> 8) & 255) / 255, (num & 255) / 255];
}

Expand Down
2 changes: 1 addition & 1 deletion src/content/Backgrounds/Particles/Particles.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const hexToRgb = hex => {
.map(c => c + c)
.join('');
}
const int = parseInt(hex, 16);
const int = parseInt(hex.slice(0, 6), 16);
const r = ((int >> 16) & 255) / 255;
const g = ((int >> 8) & 255) / 255;
const b = (int & 255) / 255;
Expand Down
2 changes: 1 addition & 1 deletion src/content/Backgrounds/PrismaticBurst/PrismaticBurst.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ const hexToRgb01 = hex => {
b = h[2];
h = r + r + g + g + b + b;
}
const intVal = parseInt(h, 16);
const intVal = parseInt(h.slice(0, 6), 16);
if (isNaN(intVal) || (h.length !== 6 && h.length !== 8)) return [1, 1, 1];
const r = ((intVal >> 16) & 255) / 255;
const g = ((intVal >> 8) & 255) / 255;
Expand Down
2 changes: 1 addition & 1 deletion src/content/Components/Folder/Folder.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const darkenColor = (hex, percent) => {
.map(c => c + c)
.join('');
}
const num = parseInt(color, 16);
const num = parseInt(color.slice(0, 6), 16);
let r = (num >> 16) & 0xff;
let g = (num >> 8) & 0xff;
let b = num & 0xff;
Expand Down
2 changes: 1 addition & 1 deletion src/tailwind/Animations/CursorGrid/CursorGrid.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const FALLOFF_CURVES = {
const hexToRgb = hex => {
const h = hex.replace('#', '');
const v = h.length === 3 ? h.split('').map(c => c + c).join('') : h;
const num = parseInt(v, 16);
const num = parseInt(v.slice(0, 6), 16);
return [(num >> 16) & 255, (num >> 8) & 255, num & 255];
};

Expand Down
2 changes: 1 addition & 1 deletion src/tailwind/Animations/ElectricBorder/ElectricBorder.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function hexToRgba(hex, alpha = 1) {
.map(c => c + c)
.join('');
}
const int = parseInt(h, 16);
const int = parseInt(h.slice(0, 6), 16);
const r = (int >> 16) & 255;
const g = (int >> 8) & 255;
const b = int & 255;
Expand Down
2 changes: 1 addition & 1 deletion src/tailwind/Animations/LaserFlow/LaserFlow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ export const LaserFlow = ({
.split('')
.map(x => x + x)
.join('');
const n = parseInt(c, 16) || 0xffffff;
const n = parseInt(c.slice(0, 6), 16) || 0xffffff;
return { r: ((n >> 16) & 255) / 255, g: ((n >> 8) & 255) / 255, b: (n & 255) / 255 };
};

Expand Down
2 changes: 1 addition & 1 deletion src/tailwind/Backgrounds/FaultyTerminal/FaultyTerminal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ function hexToRgb(hex) {
.split('')
.map(c => c + c)
.join('');
const num = parseInt(h, 16);
const num = parseInt(h.slice(0, 6), 16);
return [((num >> 16) & 255) / 255, ((num >> 8) & 255) / 255, (num & 255) / 255];
}

Expand Down
2 changes: 1 addition & 1 deletion src/tailwind/Backgrounds/Particles/Particles.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const hexToRgb = hex => {
.map(c => c + c)
.join('');
}
const int = parseInt(hex, 16);
const int = parseInt(hex.slice(0, 6), 16);
const r = ((int >> 16) & 255) / 255;
const g = ((int >> 8) & 255) / 255;
const b = (int & 255) / 255;
Expand Down
2 changes: 1 addition & 1 deletion src/tailwind/Backgrounds/PrismaticBurst/PrismaticBurst.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ const hexToRgb01 = hex => {
b = h[2];
h = r + r + g + g + b + b;
}
const intVal = parseInt(h, 16);
const intVal = parseInt(h.slice(0, 6), 16);
if (isNaN(intVal) || (h.length !== 6 && h.length !== 8)) return [1, 1, 1];
const r = ((intVal >> 16) & 255) / 255;
const g = ((intVal >> 8) & 255) / 255;
Expand Down
2 changes: 1 addition & 1 deletion src/tailwind/Components/Folder/Folder.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const darkenColor = (hex, percent) => {
.map(c => c + c)
.join('');
}
const num = parseInt(color, 16);
const num = parseInt(color.slice(0, 6), 16);
let r = (num >> 16) & 0xff;
let g = (num >> 8) & 0xff;
let b = num & 0xff;
Expand Down
2 changes: 1 addition & 1 deletion src/ts-default/Animations/CursorGrid/CursorGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const FALLOFF_CURVES: Record<Falloff, (t: number) => number> = {
const hexToRgb = (hex: string): [number, number, number] => {
const h = hex.replace('#', '');
const v = h.length === 3 ? h.split('').map(c => c + c).join('') : h;
const num = parseInt(v, 16);
const num = parseInt(v.slice(0, 6), 16);
return [(num >> 16) & 255, (num >> 8) & 255, num & 255];
};

Expand Down
2 changes: 1 addition & 1 deletion src/ts-default/Animations/LaserFlow/LaserFlow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ export const LaserFlow: React.FC<Props> = ({
.split('')
.map(x => x + x)
.join('');
const n = parseInt(c, 16) || 0xffffff;
const n = parseInt(c.slice(0, 6), 16) || 0xffffff;
return { r: ((n >> 16) & 255) / 255, g: ((n >> 8) & 255) / 255, b: (n & 255) / 255 };
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ function hexToRgb(hex: string): [number, number, number] {
.split('')
.map(c => c + c)
.join('');
const num = parseInt(h, 16);
const num = parseInt(h.slice(0, 6), 16);
return [((num >> 16) & 255) / 255, ((num >> 8) & 255) / 255, (num & 255) / 255];
}

Expand Down
2 changes: 1 addition & 1 deletion src/ts-default/Backgrounds/Particles/Particles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const hexToRgb = (hex: string): [number, number, number] => {
.map(c => c + c)
.join('');
}
const int = parseInt(hex, 16);
const int = parseInt(hex.slice(0, 6), 16);
const r = ((int >> 16) & 255) / 255;
const g = ((int >> 8) & 255) / 255;
const b = (int & 255) / 255;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ const hexToRgb01 = (hex: string): [number, number, number] => {
b = h[2];
h = r + r + g + g + b + b;
}
const intVal = parseInt(h, 16);
const intVal = parseInt(h.slice(0, 6), 16);
if (isNaN(intVal) || (h.length !== 6 && h.length !== 8)) return [1, 1, 1];
const r = ((intVal >> 16) & 255) / 255;
const g = ((intVal >> 8) & 255) / 255;
Expand Down
2 changes: 1 addition & 1 deletion src/ts-default/Components/Folder/Folder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const darkenColor = (hex: string, percent: number): string => {
.map(c => c + c)
.join('');
}
const num = parseInt(color, 16);
const num = parseInt(color.slice(0, 6), 16);
let r = (num >> 16) & 0xff;
let g = (num >> 8) & 0xff;
let b = num & 0xff;
Expand Down
2 changes: 1 addition & 1 deletion src/ts-tailwind/Animations/CursorGrid/CursorGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const FALLOFF_CURVES: Record<Falloff, (t: number) => number> = {
const hexToRgb = (hex: string): [number, number, number] => {
const h = hex.replace('#', '');
const v = h.length === 3 ? h.split('').map(c => c + c).join('') : h;
const num = parseInt(v, 16);
const num = parseInt(v.slice(0, 6), 16);
return [(num >> 16) & 255, (num >> 8) & 255, num & 255];
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function hexToRgba(hex: string, alpha: number = 1): string {
.map(c => c + c)
.join('');
}
const int = parseInt(h, 16);
const int = parseInt(h.slice(0, 6), 16);
const r = (int >> 16) & 255;
const g = (int >> 8) & 255;
const b = int & 255;
Expand Down
2 changes: 1 addition & 1 deletion src/ts-tailwind/Animations/LaserFlow/LaserFlow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ function hexToRGB(hex: string) {
.split('')
.map(x => x + x)
.join('');
const n = parseInt(c, 16) || 0xffffff;
const n = parseInt(c.slice(0, 6), 16) || 0xffffff;
return { r: ((n >> 16) & 255) / 255, g: ((n >> 8) & 255) / 255, b: (n & 255) / 255 };
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ function hexToRgb(hex: string): [number, number, number] {
.split('')
.map(c => c + c)
.join('');
const num = parseInt(h, 16);
const num = parseInt(h.slice(0, 6), 16);
return [((num >> 16) & 255) / 255, ((num >> 8) & 255) / 255, (num & 255) / 255];
}

Expand Down
2 changes: 1 addition & 1 deletion src/ts-tailwind/Backgrounds/Particles/Particles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const hexToRgb = (hex: string): [number, number, number] => {
.map(c => c + c)
.join('');
}
const int = parseInt(hex, 16);
const int = parseInt(hex.slice(0, 6), 16);
const r = ((int >> 16) & 255) / 255;
const g = ((int >> 8) & 255) / 255;
const b = (int & 255) / 255;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ const hexToRgb01 = (hex: string): [number, number, number] => {
b = h[2];
h = r + r + g + g + b + b;
}
const intVal = parseInt(h, 16);
const intVal = parseInt(h.slice(0, 6), 16);
if (isNaN(intVal) || (h.length !== 6 && h.length !== 8)) return [1, 1, 1];
const r = ((intVal >> 16) & 255) / 255;
const g = ((intVal >> 8) & 255) / 255;
Expand Down
2 changes: 1 addition & 1 deletion src/ts-tailwind/Components/Folder/Folder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const darkenColor = (hex: string, percent: number): string => {
.map(c => c + c)
.join('');
}
const num = parseInt(color, 16);
const num = parseInt(color.slice(0, 6), 16);
let r = (num >> 16) & 0xff;
let g = (num >> 8) & 0xff;
let b = num & 0xff;
Expand Down