tibberous Posted September 22, 2007 Share Posted September 22, 2007 I need a function that takes a color and returns true for false depending on whether or not it is a color. I want it to support the following formats: #000 #FFFFFF rgb(255, 255, 255) All the color names: http://www.javascripter.net/faq/colornam.htm#top Basically it is three semi-easy regex expressions and a big array with an in array check. I was wondering if there was already one written, I Googled but couldn't find anything. Thanks Quote Link to comment Share on other sites More sharing options...
Jessica Posted September 22, 2007 Share Posted September 22, 2007 Probably not, since those are three very different color formats. You might want to write each one as a function and then have one large function that checks each. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.