Click here to Skip to main content
Licence 
First Posted 28 Jun 2003
Views 175,294
Bookmarked 101 times

Color Picker Control for your Web site – A HTML Component (HTC)

Color Picker Control for your Web site – A HTML Component (HTC)

Sample Image - WebPalette.png

Sample image - NamedColors.png

Sample image - SystemColors.png

Sample image - CustomColor.png

Introduction

When I look at the code project articles for color picker control, it has bunch of excellent color picker controls but all are rich-client controls written in MFC, .NET, etc. But no one has written for web environments (thin-clients). If I search web for free ‘web based’ color picker controls, I have to invest lot of money for this. Some sites are providing the controls freely but not looking good. So, here I have tried my best to implement color picker control for web environments. This Color picker control is fully written as a HTC component by using HTML and DHTML.

To learn about HTC please visit:

Special Features

  • Fully functional at client side (pure thin client) and no round trips to the server
  • Reusable HTC Component. So it takes all the advantages of HTC
  • Advanced controls like Tab Control, Tab Pages, Sliders are implemented in this HTC as a normal html pages
  • Look and Feel UI for picking all types of color combinations
  • Color navigations divided into four different regions such as Web palette, Named colors, system colors, custom color (exactly like a Visual Studio.NET IDE Color Picker style)
  • All controls are created at run time and optimized for speed
  • Full "interactive help" like tool tips, descriptions provided to all tab pages

Limitation

At present, only IE 5.0 or later browsers support this HTC technology. Microsoft is still waiting for World Wide Web Consortium adoption. So, to successfully deploy this control on a Web site, a browser detection routine is required to ensure the user is running a version of IE 5.0 or later before launching the components.

Files

This control pack contains the following 4 files :-

  • ColorPicker.htc : Core component contains all business logic implemented by myself.
  • ColorPicker.htm : Html page will be displayed in dialog box and it has one instance of the above ColorPicker.htc component.
  • mpc.htc : Multipage control (tab control for web) implemented by Microsoft
  • MyWebPage.htm : Sample web page using color picker control
     

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Venkatakarthikeyan Natarajamoorthy

Software Developer (Senior)

United States United States

Member

Venkat Nataraj works as a Technical Consultant for GE Healthcare, USA. Earlier, he worked as a Software Tech Lead for Dell Inc, System Analyst for Satyam Computer Services and Software Engineering Consultant for GE Power Systems, Bently Nevada. He is an MCSD.NET early achiever. He has been working in the last 11+ years in software design and development of leading-edge business solutions with various development tools, technologies, platforms, and architectures. Here is the latest certifications by him:
 
• General Electric (GE) Certified GE Green Belt in Six Sigma
• Microsoft Certified Professional (MCP)
• Microsoft Certified Application Developer for Microsoft .NET (MCAD.NET)
• Microsoft Certified Solution Developer for Microsoft .NET (MCSD.NET)
• MCSD.NET Early achiever
• Brainbench Certified Visual C++ programmer
• Computer Society of India (CSI) awarded first place in the inter-college Computer Quiz Competition
• Computer Society of India (CSI) awarded first place in the inter-college Software Contest
• Received “Process Innovation” award from Dell Inc
 
He spends his free time with music, watching hollywood movies and Sujatha's stories. His favorite musician is Ilayaraja. Bringing real music to his soul and heart. Hariharan is his most favorite singer.

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralFirst Bangladeshi Minilab Web Site, www.minilabbd.com Pinmemberminilabbd5:15 4 May '09  
QuestionHow to use this control in my project?? Pinmemberckietmca23:40 1 Jan '08  
AnswerRe: How to use this control in my project?? Pinmemberckietmca20:16 8 Jan '08  
Hi
After doing some R&D I got the way to use in my project.Its so simple simply add these file .htc and .html in your project and call a function (java script) on your invoking control. Take help of java script code from source view code in running sample.
 
Happy coding!!! Smile | :)
GeneralDoes function in Firefox PinmemberDavid Rodecker21:26 19 Apr '06  
GeneralRe: Does function in Firefox PinmemberSaad Hasan23:34 5 Oct '06  
GeneralRe: Does function in Firefox Pinmemberwebber1234569:13 22 Jun '07  
GeneralDoesn't Seem to work in IE Pinmemberchris lasater8:28 20 Mar '06  
AnswerRe: Doesn't Seem to work in IE PinmemberViper300023:49 26 Nov '06  
Newsvery good !but…… Pinmemberjerrie_114:38 18 Jan '06  
Generalcolor picker Pinmemberhitman844:33 5 Dec '05  
GeneralRe: color picker PinmemberVenkatakarthikeyan Natarajamoorthy1:11 12 Sep '06  
QuestionAnyone tried using this in Mozilla with moz-behaviors? Pinmembermikebridge12:15 15 Nov '05  
AnswerRe: Anyone tried using this in Mozilla with moz-behaviors? Pinmemberwebber1234569:11 22 Jun '07  
GeneralVery good Pinmemberponto11:29 13 Oct '05  
General.comquery Pinmemberdevraj7007@yahoo.com22:13 5 Sep '05  
Generalquery Pinmemberdevraj700722:12 5 Sep '05  
GeneralBravo PinmemberAbishek Bellamkonda21:08 20 Jun '05  
GeneralHtml PinmemberShahrose16:57 30 Apr '04  
GeneralI like this forum! Pinmemberquocnho17:52 29 Jan '04  
GeneralCool ! Kudos to VN. PinmemberEtchEmKay20:24 20 Nov '03  
GeneralRe: Cool ! Kudos to VN. PinmemberElsen0:49 27 Apr '05  
QuestionInternationalization of HTC? Pinsussklh71719:42 29 Sep '03  
GeneralExcellent Control PinmemberGhanashyam20:52 1 Jul '03  
GeneralWonderful Control PinmemberNavin_2000320:59 30 Jun '03  
GeneralGreat Control... No Discussion PinmemberJarrett Vance8:35 30 Jun '03  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web02 | 2.5.120529.1 | Last Updated 29 Jun 2003
Article Copyright 2003 by Venkatakarthikeyan Natarajamoorthy
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid