The user of the ASP.NET web app I\'m building can select colors for use on some of the elements (e.g. buttons/titles) to facilitate some degree of personalisation.
Convert to HSL and look at the Luminance value. This will tell you how bright it is.
L
Here is a javascript function for doing the conversion.