mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-19 14:14:17 +00:00
@@ -15,8 +15,8 @@ export const getAccessibleColour = (bgColour?: string): ColourCombination => {
|
|||||||
try {
|
try {
|
||||||
const textColor = Color(bgColour).isLight() ? 'black' : '#fffffa';
|
const textColor = Color(bgColour).isLight() ? 'black' : '#fffffa';
|
||||||
return { backgroundColor: bgColour, color: textColor };
|
return { backgroundColor: bgColour, color: textColor };
|
||||||
} catch (error) {
|
} catch (_error) {
|
||||||
console.log(`Unable to parse colour: ${bgColour}`);
|
/* we do not handle errors here */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return { backgroundColor: '#000', color: '#fffffa' };
|
return { backgroundColor: '#000', color: '#fffffa' };
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { useRef } from 'react';
|
import { useRef } from 'react';
|
||||||
import { ColumnDef, flexRender, getCoreRowModel, useReactTable } from '@tanstack/react-table';
|
import { ColumnDef, flexRender, getCoreRowModel, useReactTable } from '@tanstack/react-table';
|
||||||
|
import Color from 'color';
|
||||||
import { isOntimeBlock, isOntimeDelay, isOntimeEvent, OntimeRundown, OntimeRundownEntry } from 'ontime-types';
|
import { isOntimeBlock, isOntimeDelay, isOntimeEvent, OntimeRundown, OntimeRundownEntry } from 'ontime-types';
|
||||||
|
|
||||||
import useFollowComponent from '../../common/hooks/useFollowComponent';
|
import useFollowComponent from '../../common/hooks/useFollowComponent';
|
||||||
@@ -117,6 +118,14 @@ export default function Cuesheet({ data, columns, handleUpdate, selectedId }: Cu
|
|||||||
let rowBgColour: string | undefined;
|
let rowBgColour: string | undefined;
|
||||||
if (isSelected) {
|
if (isSelected) {
|
||||||
rowBgColour = 'var(--cuesheet-running-bg-override, #D20300)'; // $red-700
|
rowBgColour = 'var(--cuesheet-running-bg-override, #D20300)'; // $red-700
|
||||||
|
} else if (row.original.colour) {
|
||||||
|
try {
|
||||||
|
// the colour is user defined and might be invalid
|
||||||
|
const colour = new Color(row.original.colour).alpha(0.25);
|
||||||
|
rowBgColour = colour.hsl().string();
|
||||||
|
} catch (_error) {
|
||||||
|
/* we do not handle errors here */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user