This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const DICTIONARY = { | |
| // CRUD Operations with Target Subject | |
| crud: { | |
| create: '{subject} created successfully!', | |
| read: '{subject} loaded successfully!', | |
| update: '{subject} updated successfully!', | |
| delete: '{subject} deleted successfully!', | |
| save: '{subject} saved successfully!', | |
| add: '{subject} added successfully!', | |
| remove: '{subject} removed successfully!', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function getContrastColor(hexColor: string): string { | |
| const hexToRgb = (hex: string) => hex.match(/[A-Fa-f0-9]{2}/g)!.map((v) => parseInt(v, 16)) | |
| const rgbToHex = (r: number, g: number, b: number) => `#${r.toString(16).padStart(2, '0')}${g.toString(16).padStart(2, '0')}${b.toString(16).padStart(2, '0')}` | |
| // Extract RGB components from the hex color | |
| const [r, g, b] = hexToRgb(hexColor) | |
| // Calculate the relative luminance for the provided color | |
| const luminance = (0.2126 * r + 0.7152 * g + 0.0722 * b) / 255 |