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-white.png

Missed SAS Innovate in Orlando?

Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.

 

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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