mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-16 04:43:35 +00:00
Colorised spreadsheet (#1643)
* feat: colorise spreadSheet with rundown color * feat: add colorisation in spreadsheet for block * feat: border color * fix: cleanup accessible color * fix: review before merge (https://github.com/cpvalente/ontime/pull/1608) * fix: usgae of map instead foreach (https://github.com/cpvalente/ontime/pull/1608) * Update apps/server/src/services/sheet-service/SheetService.ts Co-authored-by: Carlos Valente <34649812+cpvalente@users.noreply.github.com> * fix: comment condition * fix: Remove Color plugin (but don't can get color like 'red' or 'black') * fix: isLight for more clean code * fix: remove map on isLight function * fix: remove debug logger * refactor colour * lint --------- Co-authored-by: Gwenitora <gwenitora.gardu74@gmail.com> Co-authored-by: Gwenitora <61121870+Gwenitora@users.noreply.github.com> Co-authored-by: Carlos Valente <34649812+cpvalente@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
984dcb0181
commit
4872cd0a48
@@ -18,19 +18,19 @@ describe('getAccessibleColour()', () => {
|
||||
it('handles named colours', () => {
|
||||
const colour = 'red';
|
||||
const { backgroundColor, color } = getAccessibleColour(colour);
|
||||
expect(backgroundColor).toBe('#FF0000FF');
|
||||
expect(backgroundColor).toBe('#ff0000ff');
|
||||
expect(color).toBe('#fffffa');
|
||||
});
|
||||
it('handles hex colours', () => {
|
||||
const colour = '#0F0';
|
||||
const { backgroundColor, color } = getAccessibleColour(colour);
|
||||
expect(backgroundColor).toBe('#00FF00FF');
|
||||
expect(backgroundColor).toBe('#00ff00ff');
|
||||
expect(color).toBe('black');
|
||||
});
|
||||
it('handles transparens', () => {
|
||||
const colour = '#0F08';
|
||||
const { backgroundColor, color } = getAccessibleColour(colour);
|
||||
expect(backgroundColor).toBe('#0C940CFF');
|
||||
expect(backgroundColor).toBe('#0c940cff');
|
||||
expect(color).toBe('#fffffa');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user