Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
304cfb5be7 | ||
|
|
02abf8f88c |
No files matched your search
@@ -193,7 +193,7 @@ describe("theme-contrast", () => {
|
||||
expect(result.pairs.length).toBeGreaterThan(0);
|
||||
expect(result.byName.body).toBeDefined();
|
||||
expect(result.byName.primary).toBeDefined();
|
||||
expect(result.byName.accent).toBe("#ffffff");
|
||||
expect(result.byName.accent).toBe("#000000");
|
||||
});
|
||||
|
||||
it("handles missing keys with defaults", () => {
|
||||
|
||||
@@ -28,7 +28,7 @@ export interface AdminPalette {
|
||||
}
|
||||
|
||||
/** Pure / near-white public surfaces → soft admin paper (less eye strain). */
|
||||
function softLightSurface(
|
||||
export function softLightSurface(
|
||||
value: string | undefined,
|
||||
softDefault: string,
|
||||
): string {
|
||||
@@ -262,7 +262,7 @@ export function ensureReadableThemeColors(
|
||||
return out;
|
||||
}
|
||||
|
||||
function parseHex(value: string): Rgb | null {
|
||||
export function parseHex(value: string): Rgb | null {
|
||||
const trimmed = value.trim();
|
||||
const short = /^#([0-9a-f]{3})$/i.exec(trimmed);
|
||||
if (short) {
|
||||
@@ -282,7 +282,7 @@ function parseHex(value: string): Rgb | null {
|
||||
];
|
||||
}
|
||||
|
||||
function relativeLuminance(rgb: Rgb): number {
|
||||
export function relativeLuminance(rgb: Rgb): number {
|
||||
const [red, green, blue] = rgb.map((channel) => {
|
||||
const value = channel / 255;
|
||||
return value <= 0.04045 ? value / 12.92 : ((value + 0.055) / 1.055) ** 2.4;
|
||||
|
||||
Reference in new issue
Block a user