What better than a dice to generate random numbers ?

However, it is not very easy to roll a dice even with HTML5 canvas !
Here is an essay which roll with drag and drop or touch and move...

But before trying to roll it like a real Dice, I'd like to solve the problem of its shape which appears with a coloured background (see this page).

Thank you for any comments or proposals.