Darkness stacks every 0.25 seconds up to a maximum of 5000 stacks. Each stack deals 2% of your eHP per second. (0.5% at 75% darkness resistance). Without any mitigation or regeneration you will die in darkness at 20 stacks (5 seconds). First second you will miss 5% ehp, then - 18%, 39%, 68% and 105% at the 5 second.
Hidden november's 2018th change: there is now a cap of maximum stacks that one can handle with sufficient amount of flat regeneration.
At 0% of the darkness resistance if regeneration applied to Life pool it will produce (1 / 1516) of degen per stack. The cap will be at 1516 darkness stacks with 1 eHP so.
If regeneration is applied to energy shield instead, the degen will produce (ES / eHP / 1516) of degen per stack. The cap will be at 1137 stacks with 4 eHP (3 ES) character.
Note: the new hidden degen cannot be mitigated by any % life regen. But (as well as the main Darkness damage) it can be mitigated by reduced damage taken over time modifiers (Arakaali's pantheon, Leo's craft); by Mind over Matter keystone (*1,3) and Kintsugi body armour (*1,25).
In order to calculate number of stacks which you can handle with your regeneration use formula: "maximum stacks = (all the mitigations) * regenetaion * 50 / eHP "