<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: PROC SGPLOT Default Colour in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-Default-Colour/m-p/527268#M17674</link>
    <description>&lt;P&gt;You can do like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname temp "C:/temp";
proc template;
source styles.statistical / file='temp.tmp'; /* write template to text file */
quit;
 
data Colors;
keep Name Color R G B;
length Name Color $8;
infile 'temp.tmp';
input;
k = find(_infile_,'gdata','i');/* EDIT: Use gdata instead of gcdata */
if k &amp;gt; 0 then do;
   s = substr(_infile_, k);
   j = index(s, "'");
   Name = substr(s, 1, j-1);
   j = index(s, "=");
   Color = compress(substr(s, j+1));
   R = inputn(substr(Color, 3, 2), "HEX2.");
   G = inputn(substr(Color, 5, 2), "HEX2.");
   B = inputn(substr(Color, 7, 2), "HEX2.");
end;
if k &amp;gt; 0;
run;
 
proc print data=Colors; 
var Name Color R G B;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The approach is from &lt;A href="https://blogs.sas.com/content/iml/2017/02/06/group-colors-sgplot.html" target="_self"&gt;What colors does PROC SGPLOT use for markers?&lt;/A&gt;. I edited the code a little bit and commented the main change: looking for gdata instead of gcdata in the template file. In the Colors data set,&amp;nbsp;gdata1 is the first color used, gdata2 is number two and so on.&lt;/P&gt;</description>
    <pubDate>Tue, 15 Jan 2019 11:43:17 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2019-01-15T11:43:17Z</dc:date>
    <item>
      <title>PROC SGPLOT Default Colour</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-Default-Colour/m-p/527257#M17673</link>
      <description>&lt;P&gt;Hello SAS community. I have written a PROC SGPLOT code that includes the BLOCK statement generating beautiful graphs. I need to identify the default colors used but confused by the several HLS/RGB/HSV options. I used the default template i.e HTMLBlue. I was wondering if someone can point me to some useful way of identifying the precise colors presented in each block. My code is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC SGPLOT DATA = Labs;&lt;BR /&gt;BLOCK X = age_weeks BLOCK = PHASES /TRANSPARENCY=0.8 POSITION=CENTER VALUEFITPOLICY=/*NONE | SHRINK |SPLIT*/ SPLIT SPLITCHAR='';&lt;BR /&gt;SERIES X = age_weeks Y = cd4_percent / MARKERS MARKERATTRS=(COLOR=BLACK SYMBOL=CIRCLE) LINEATTRS = (COLOR=RED THICKNESS = 2 PATTERN=DASH) LEGENDLABEL = 'CD4 Percent';&lt;BR /&gt;XAXIS LABEL = 'Weeks';&lt;BR /&gt;YAXIS MIN=30 LABEL = 'CD4 Percent values';&lt;BR /&gt;RUN;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jan 2019 10:06:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-Default-Colour/m-p/527257#M17673</guid>
      <dc:creator>Naviava1973</dc:creator>
      <dc:date>2019-01-15T10:06:58Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SGPLOT Default Colour</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-Default-Colour/m-p/527268#M17674</link>
      <description>&lt;P&gt;You can do like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname temp "C:/temp";
proc template;
source styles.statistical / file='temp.tmp'; /* write template to text file */
quit;
 
data Colors;
keep Name Color R G B;
length Name Color $8;
infile 'temp.tmp';
input;
k = find(_infile_,'gdata','i');/* EDIT: Use gdata instead of gcdata */
if k &amp;gt; 0 then do;
   s = substr(_infile_, k);
   j = index(s, "'");
   Name = substr(s, 1, j-1);
   j = index(s, "=");
   Color = compress(substr(s, j+1));
   R = inputn(substr(Color, 3, 2), "HEX2.");
   G = inputn(substr(Color, 5, 2), "HEX2.");
   B = inputn(substr(Color, 7, 2), "HEX2.");
end;
if k &amp;gt; 0;
run;
 
proc print data=Colors; 
var Name Color R G B;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The approach is from &lt;A href="https://blogs.sas.com/content/iml/2017/02/06/group-colors-sgplot.html" target="_self"&gt;What colors does PROC SGPLOT use for markers?&lt;/A&gt;. I edited the code a little bit and commented the main change: looking for gdata instead of gcdata in the template file. In the Colors data set,&amp;nbsp;gdata1 is the first color used, gdata2 is number two and so on.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jan 2019 11:43:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-Default-Colour/m-p/527268#M17674</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-01-15T11:43:17Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SGPLOT Default Colour</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-Default-Colour/m-p/527273#M17675</link>
      <description>&lt;P&gt;Thank you very much Draycut. This is helpful.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jan 2019 12:42:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-Default-Colour/m-p/527273#M17675</guid>
      <dc:creator>Naviava1973</dc:creator>
      <dc:date>2019-01-15T12:42:55Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SGPLOT Default Colour</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-Default-Colour/m-p/527354#M17676</link>
      <description>&lt;P&gt;I'm glad to hear that &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Please let me know if I can help you with anything else. Otherwise, please mark this thread as a solution.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jan 2019 16:02:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-Default-Colour/m-p/527354#M17676</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-01-15T16:02:42Z</dc:date>
    </item>
  </channel>
</rss>

