BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
sarahsasuser
Quartz | Level 8

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

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

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 Smiley Happy

View solution in original post

4 REPLIES 4
Reeza
Super User

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 Smiley Happy

sarahsasuser
Quartz | Level 8

Thanks Reeza! That was exactly what I was looking for.

GraphGuy
Meteorite | Level 14

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.

sarahsasuser
Quartz | Level 8

That's a great idea, thanks Robert!

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1716 views
  • 2 likes
  • 3 in conversation