Hacker News new | past | comments | ask | show | jobs | submit login

This doesn't work with CSS, right? Only the color attribute of HTML.



From the article:

> CSS has its own set of fascinating peculiarities when it comes to handling invalid colour values. Most modern browsers will clamp values rather than reject them outright -– throw rgb(300, -50, 1000) at a browser and it won't fail; it'll helpfully transform it into rgb(255, 0, 255).


Yeah it addresses that towards the end of the article. CSS has different rules for parsing badly formatted colors. Unsurprising given that CSS colors can be in several different formats (hex, RGB, RGBA, HCL etc.).




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: