Select to view content in your preferred language

JavaScript Color Palette in RGB rather than Hexidecimal?

3439
6
Jump to solution
08-04-2014 06:59 AM
IanPeebles
Frequent Contributor

I am currently using the JavaScript color pallete from dijit.ColorPalette.  Is there a color pallete that contains RGB values?  The reason I am asking is that I want to make polygon features transparent.

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
TimWitt2
MVP Alum

Ian,

you could set the opacity property when you create your graphic or later on use the setOpacity method of your graphic layer to do that.

Tim

View solution in original post

0 Kudos
6 Replies
TimWitt2
MVP Alum

You could use the color picker instead? dojox.widget.ColorPicker — The Dojo Toolkit - Reference Guide

0 Kudos
RiyasDeen
Frequent Contributor

Still with RGB alone you can't create transparency, you'll need to alpha as well.

IanPeebles
Frequent Contributor

Thanks for the feedback so far.  What would be the best solution to allow the user to choose from a variety of colors and have the transparency set at 50 percent?  So far, I have the color palette working, yet the graphics are a solid fill.  I am looking for something simple.

0 Kudos
TimWitt2
MVP Alum

Ian,

you could set the opacity property when you create your graphic or later on use the setOpacity method of your graphic layer to do that.

Tim

0 Kudos
IanPeebles
Frequent Contributor

Thanks for all of the responses.  I set a transparency for all graphics, using a opacity of .25.  Here is how it turned out:

GraphicsTransparent.jpg

TimWitt2
MVP Alum

I'm glad it worked!