chore: lint-format-docs-tests-bugfixes (#105)
* docs: add jsdoc * feat: change enums to as const objects * chore(test): add themeColors.test.ts * fix: fix tests and bugs with strings.ts util * fix: path alias imports and tsconfig file bug * fix: remove --max-warnings 0
This commit is contained in:
@@ -1,11 +1,19 @@
|
||||
import { theme } from 'unocss/preset-mini';
|
||||
|
||||
/**
|
||||
* Represents the colors for a course.
|
||||
*/
|
||||
export interface CourseColors {
|
||||
primaryColor: string;
|
||||
secondaryColor: string;
|
||||
}
|
||||
|
||||
// calculates luminance of a hex string
|
||||
/**
|
||||
* Calculates the luminance of a given hexadecimal color.
|
||||
*
|
||||
* @param hex - The hexadecimal color value.
|
||||
* @returns The luminance value between 0 and 1.
|
||||
*/
|
||||
export function getLuminance(hex: string): number {
|
||||
let r = parseInt(hex.substring(1, 3), 16);
|
||||
let g = parseInt(hex.substring(3, 5), 16);
|
||||
|
||||
Reference in New Issue
Block a user