mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-04-16 05:51:57 +01:00
chore: Apply linting rules and add git hok (#611)
Co-authored-by: Fredrik Burmester <fredrik.burmester@gmail.com>
This commit is contained in:
@@ -7,9 +7,9 @@ interface ThemeColors {
|
||||
|
||||
export const calculateTextColor = (backgroundColor: string): string => {
|
||||
// Convert hex to RGB
|
||||
const r = parseInt(backgroundColor.slice(1, 3), 16);
|
||||
const g = parseInt(backgroundColor.slice(3, 5), 16);
|
||||
const b = parseInt(backgroundColor.slice(5, 7), 16);
|
||||
const r = Number.parseInt(backgroundColor.slice(1, 3), 16);
|
||||
const g = Number.parseInt(backgroundColor.slice(3, 5), 16);
|
||||
const b = Number.parseInt(backgroundColor.slice(5, 7), 16);
|
||||
|
||||
// Calculate perceived brightness
|
||||
// Using the formula: (R * 299 + G * 587 + B * 114) / 1000
|
||||
@@ -47,9 +47,9 @@ const calculateRelativeLuminance = (rgb: number[]): number => {
|
||||
};
|
||||
|
||||
export const isCloseToBlack = (color: string): boolean => {
|
||||
const r = parseInt(color.slice(1, 3), 16);
|
||||
const g = parseInt(color.slice(3, 5), 16);
|
||||
const b = parseInt(color.slice(5, 7), 16);
|
||||
const r = Number.parseInt(color.slice(1, 3), 16);
|
||||
const g = Number.parseInt(color.slice(3, 5), 16);
|
||||
const b = Number.parseInt(color.slice(5, 7), 16);
|
||||
|
||||
// Check if the color is very dark (close to black)
|
||||
return r < 20 && g < 20 && b < 20;
|
||||
|
||||
Reference in New Issue
Block a user