Open christhornton555 opened 2 months ago
[ ] Handle colouring and contrast of tabs, relative to background colour. Here's some code: `function darkenHexColor(hex, percent) { // Convert hex to RGB let r = parseInt(hex.substring(1, 3), 16); let g = parseInt(hex.substring(3, 5), 16); let b = parseInt(hex.substring(5, 7), 16);
// Darken each color component by the given percentage r = Math.floor(r (1 - percent / 100)); g = Math.floor(g (1 - percent / 100)); b = Math.floor(b * (1 - percent / 100));
// Ensure each value is within the 0-255 range and convert back to hex
const newColor = #${r.toString(16).padStart(2, '0')}${g.toString(16).padStart(2, '0')}${b.toString(16).padStart(2, '0')}
;
return newColor; }
// Example usage const originalColor = '#ffcc99'; const darkerColor = darkenHexColor(originalColor, 10); // Darken by 10% console.log(darkerColor); // Logs the new darker color `
Render the table on the web page more like excel renders sheets