Get the brightness of a color in php

Get the brightness of a color in php

see here http://flyingsquidstudios.com/page0/”http://twitter.com/FlyingSquidLA With this function it is possible to decide the font color based on a variable background colour.