PHP Classes

True Color Picker: Present a palette to let the user pick colors

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Info   Screenshots Screenshots   View files View files (12)   DownloadInstall with Composer Download .zip   Reputation   Support forum (6)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2007-10-10 (8 years ago) RSS 2.0 feedStarStarStarStar 71%Total: 3,355 This week: 1All time: 984 This week: 1,173Down
Version License PHP version Categories  
truecolorpicker 1.0Freely Distributable4Graphics, Content management, AJAX
Description Author  

This class can be used to present a palette to let the user pick colors.

It displays an image with all the tones for the user to pick by clicking in an image point with the desired tone similar to Photoshop.

It uses AJAX to update the picker boxes without reloading the page.

Innovation Award  
PHP Programming Innovation award nominee
July 2007
Number 6

Prize: One book of choice by Packt
Some Web applications need to provide a Web interface to let the users choose colors to render different aspects of the sites.

Desktop applications, like for instance Photoshop, use color picker dialog windows that provide an user-friendly way to choose colors from a true color palette.

This package can emulate that kind of color picker dialog windows for PHP based Web applications.

Manuel Lemos
Picture of Moe Sweet
Name: Moe Sweet <contact>
Classes: 2 packages by
Country: Myanmar Myanmar
Age: 31
All time rank: 7831 in Myanmar Myanmar
Week rank: 919 Down3 in Myanmar Myanmar Down
Innovation award
Innovation award
Nominee: 1x


Developed by: Moe Sweet <>
From: Myanmar (Burma)
Date: 28-June-07

Thanks to: Sithu Kyaw, Pyone Kay Khine.

Most color pickers used on the web today only support web colors. For some applications like a garment or a paint shop, each color code should reflect the color from the real world.
TCP (True Color Picker) uses GD library to provide color picking facility as many colors as in "Photoshop" color picker.

There is only one factor you have adjust, the "detail factor". It determines how many number of steps/blocks between each corner of the 256*256 picker box. Thus maximum is 256.
When it is set to 256, the total number of colors available is 256*256*256. Minimum setting should not less than 16. Optimum is 64.

You pick a color code using GD, you re-display it using GD. The "ColorElement" class can display any valid color codes (#000000 to #ffffff) in a variable size rectangle box.


You can preload a color to TCP to show in "current" box, like Photoshop. But TCP cannot locate that color in the picker. TCP does not support CMYK color. 
They may come up in version 2.

ColorElement class does not support textures.

Tested on: Firefox 2 and IE 6.

Mail me for any questions, comments and suggestions for improvement.

Happy Picking!

  • screenshot2.png
  • screenshot.png
  Files folder image Files  
File Role Description
Files folder imageTrueColorPicker (10 files)
Plain text file example.php Example Usage example
Plain text file readme.txt Doc. Read me file

  Files folder image Files  /  TrueColorPicker  
File Role Description
  Plain text file index.php Example The one that shows the Color Picker
  Plain text file class.TrueColorPicker.php Class True Color Picker Class
  Plain text file class.ColorElement.php Class Color Element Class
  Plain text file colorPicker.js Data Javascript file that triggers Ajax functions
  Plain text file buildBrightnessBox.php Aux. A file called by Ajax, no need to modify
  Plain text file buildBrightnessTable.php Aux. A file called by Ajax, no need to modify
  Plain text file drawColorElement.php Aux. This file actually draw the color elements
  Plain text file generateBrightnessArrays.php Aux. Algorithm for calculating color codes for brightness box
  Image file hueBox.png Data The Thin Vertical Bar, I call it Hue Box, the big one, Brightness Box
  Plain text file hueColors.txt Data List of color codes of hue box

 Version Control Unique User Downloads Download Rankings  
 0%Total:3,355All time:984
 This week:1This week:1,173Down
User Ratings User Comments (2)  
 All time
I think the potential is great.
8 years ago (herve_tribouilloy)
This is simply the best Color picker app I've tested so far !
8 years ago (David Coll)