[support] OT: color swatches for drupal

Jamie Holly hovercrafter at earthlink.net
Thu Jul 30 22:01:49 UTC 2009


Luke wrote:
> I am aware of how to implement attributes and options.
>
> I need to enable the user to choose between a list of around a hundred 
> color options for a particular product.
> They need to be able to see an actual approximation of each of those 
> colors.
>
> The former site did this with a table.  The background of a cell was 
> styled to the desired color, and the link to the product was given a 
> 25X25PX transparent image, to allow the background to be viewed.
> That is not only browser dependent (among other things), it would be 
> difficult to do, unless I create a view for each product, and even then 
> it may not be enough.
>
> So I thought I could find a way to generate actual color pictures to use 
> with the UC option images module.
>
> However, I've not any idea how to generate those color pictures.
>
> Luke
>
>   
>
Making the images with PHP/GD wouldn't be complicated. Just look through 
and array of the colors you want, create the block then output it with 
the color's hex value as the filename. If not that then you would need 
some graphics program that has scripting in it, like newer versions of 
Paint Shop Pro.

Of course a better solution might be to use something like the Jquery 
Color Picker to have them select the color:

http://www.eyecon.ro/colorpicker/

Jamie Holly
http://www.intoxination.net 
http://www.hollyit.net




More information about the support mailing list