Taking pictures while driving is both illegal and dangerous.
Taking pictures while waiting for the signal to change is okay.
It is especially okay if you point, click, and hope for the best.
Here is a very random picture taken on an early morning commute when the skies seemed filled with June Gloom. The cars in the picture offer a good bit of contrast for the weight of the sky.