Opacity gives us the flexibility to use any number of decimal values we want, but HTML is limited to changing lightness in only 256 different ways. This means that the most subtle change in opacity would be noticeable when placing something black over something white, creating a visible range of 256 unique hues. The consistency in the ratio between red (R), green (G), and blue (B) values is crucial for maintaining color accuracy.
Considering the fact that the most sensitive color can have 256 variations, the smallest noticeable change in opacity would be 1/256 = 0.00390625
. In theory, this should be the minimum increment for adjusting opacity levels effectively.
In my experiment using a basic color picker with an example fiddle, I observed that only the bottom div showed a visible change in color while the top two remained at #000000
and the bottom one changed to #010101
. From this observation, I deduce that:
- The input values are not rounded, or if they are, they are always rounded down (floor function)
- The maximum precision for opacity adjustments is up to 3 decimal places.
It's worth mentioning that these findings were based on tests conducted in Google Chrome, and as mentioned by BoltClock, results may vary across different implementations.