Hi All,
I created a graph in SAS with 6 subgroups that SAS color codes by default. I would like to use these specific colors in other graphs and so need to know the rgb color codes that SAS is using. I've looked at this link that shows all the color codes in SAS (TS-DOC: TS-688 - Defining Colors using Hex Values) but I can't find the exact matches. I think it would be easier to see what codes SAS is already using, as my team likes these colors and doesn't want to change them.
thanks,
S
Figure out what template you're using then output it using proc template.
For example:
proc template;
source styles.default;
run;
Then check the log and look for lines that look like:
'gdata12' = cxDDD17E
'gdata11' = cxB7AEF1
'gdata10' = cx87C873
'gdata9' = cxCF974B
'gdata8' = cxCD7BA1
'gdata6' = cxBABC5C
'gdata7' = cx94BDE1
'gdata4' = cxA9865B
'gdata5' = cxB689CD
'gdata3' = cx66A5A0
'gdata2' = cxDE7E6F
'gdata1' = cx7C95CA;
I don't know if it's the gdata or gcdata colours (think its gdata), but it also depends on what proc you're using. If you're using ramps colours it could be something else, but this is one way to find out.
OR you can go into EG style editor tool and try and grab them from there.
Good Luck
Figure out what template you're using then output it using proc template.
For example:
proc template;
source styles.default;
run;
Then check the log and look for lines that look like:
'gdata12' = cxDDD17E
'gdata11' = cxB7AEF1
'gdata10' = cx87C873
'gdata9' = cxCF974B
'gdata8' = cxCD7BA1
'gdata6' = cxBABC5C
'gdata7' = cx94BDE1
'gdata4' = cxA9865B
'gdata5' = cxB689CD
'gdata3' = cx66A5A0
'gdata2' = cxDE7E6F
'gdata1' = cx7C95CA;
I don't know if it's the gdata or gcdata colours (think its gdata), but it also depends on what proc you're using. If you're using ramps colours it could be something else, but this is one way to find out.
OR you can go into EG style editor tool and try and grab them from there.
Good Luck
Thanks Reeza! That was exactly what I was looking for.
I installed a Windows tool called 'Pixeur' which lets me point my mouse at a color in a graph (or anywhere), and it tells me the RGB hex code for the color. I find it *very* useful for determining the colors to hard-code, to replicate the colors that were used in another graph.
That's a great idea, thanks Robert!
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.