Darken the dark canvas, add customer colours, the ongoing status and the board model
- Dark theme page background is #5a5e60; text on it is lifted to zinc-200 / primary-100 and TallStackUI's dark labels, hints and checkbox labels are lightened so everything stays at 4.5:1. - Shared HexColor picks white or black text by the higher WCAG contrast; a native-dialog colour picker and a large work dialog component. - Customers get a header colour (customers.header_color), set on the customer page. - New job status Jatkuvat / Kausi (ongoing): open, never late, billed monthly like running jobs. - Kanban model: board columns and views, urgent threshold, per-user board preferences (density, column colours and sort), card positions, tasks of continuing jobs pinned to the board, MoveBoardCard and board queries with logged hours from TimeTracking. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
use App\Modules\Shared\Domain\Exceptions\InvalidHexColor;
|
||||
use App\Modules\Shared\Domain\ValueObjects\HexColor;
|
||||
|
||||
it('normalises hex colours to lower case #rrggbb', function (string $input, string $expected): void {
|
||||
expect((new HexColor($input))->value)->toBe($expected);
|
||||
})->with([
|
||||
'upper case' => ['#1D4ED8', '#1d4ed8'],
|
||||
'short form' => ['#fA0', '#ffaa00'],
|
||||
'spaces' => [' #23476a ', '#23476a'],
|
||||
]);
|
||||
|
||||
it('rejects values that are not hex colours', function (string $input): void {
|
||||
new HexColor($input);
|
||||
})->throws(InvalidHexColor::class)->with(['1d4ed8', '#1d4ed', '#gggggg', 'red', '']);
|
||||
|
||||
it('builds a colour from rgb channels and clamps them', function (): void {
|
||||
expect(HexColor::fromRgb(29, 78, 216)->value)->toBe('#1d4ed8')
|
||||
->and(HexColor::fromRgb(-5, 300, 0)->value)->toBe('#00ff00')
|
||||
->and((new HexColor('#1d4ed8'))->rgb())->toBe([29, 78, 216]);
|
||||
});
|
||||
|
||||
it('picks white text on dark colours and dark text on light ones', function (): void {
|
||||
expect((new HexColor('#1d4ed8'))->textColor())->toBe('#ffffff')
|
||||
->and((new HexColor('#fde68a'))->textColor())->toBe('#000000')
|
||||
->and((new HexColor('#ffffff'))->isLight())->toBeTrue()
|
||||
->and((new HexColor('#000000'))->isLight())->toBeFalse();
|
||||
});
|
||||
|
||||
it('gives the text colour at least 4.5:1 on any colour', function (string $hex): void {
|
||||
$color = new HexColor($hex);
|
||||
|
||||
expect($color->contrastWith(new HexColor($color->textColor())))->toBeGreaterThanOrEqual(4.5);
|
||||
})->with(['#767676', '#808080', '#8a5cf6', '#ef4444', '#22c55e', '#1d4ed8', '#23476a', '#0f5c63', '#14532d', '#047857', '#3b2d5e', '#7c2d2d', '#b91c1c', '#9a3412', '#78350f', '#b45309', '#374151', '#4338ca', '#6d28d9', '#065f46']);
|
||||
|
||||
it('mixes a share of the colour into a base colour', function (): void {
|
||||
$base = new HexColor('#16160e');
|
||||
|
||||
expect((new HexColor('#1d4ed8'))->mixedInto($base, 0.11)->value)->toBe('#171c24')
|
||||
->and((new HexColor('#1d4ed8'))->mixedInto($base, 0.0)->value)->toBe('#16160e')
|
||||
->and((new HexColor('#1d4ed8'))->mixedInto($base, 1.0)->value)->toBe('#1d4ed8');
|
||||
});
|
||||
Reference in New Issue
Block a user