%let name=color_blindness_test; filename odsout '.'; /* Create the 'map' dataset. */ data circular_map; length id $20; do grid_y=1 to 50; do grid_x=1 to 50; /* If this falls within the a certain radius, use it */ distance_from_center=sqrt( ((grid_x-25.5)*(grid_x-25.5)) + ((grid_y-25.5)*(grid_y-25.5)) ); if distance_from_center <= 24 then do; id=trim(left(grid_x))||'_'||trim(left(grid_y)); random_size=(.5*ranuni(76542))+.3; middle_x=grid_x-.5; middle_y=grid_y-.5; x=middle_x-(random_size/2); y=middle_y-(random_size/2); output; x=middle_x+(random_size/2); y=middle_y-(random_size/2); output; x=middle_x+(random_size/2); y=middle_y+(random_size/2); output; x=middle_x-(random_size/2); y=middle_y+(random_size/2); output; end; end; end; run; proc sql noprint; create table color_data as select unique id, distance_from_center from circular_map; quit; run; data color_data; set color_data; length text $20 my_html $300; if distance_from_center>12 and distance_from_center<17 then ring=1; else ring=0; /* set colorval to 1, 2, or 3 */ if ring=1 then do; valcolor=round(ranuni(456)*2)+1; text='ring'; end; /* set colorval to 4, 5, or 6 */ else if ring=0 then do; valcolor=round(ranuni(456)*2)+1+3; text='background'; end; my_html= 'title='||quote(trim(left(text)))|| ' href="color_blindness_test_info.htm"'; run; goptions device=png; goptions cback=white; goptions hsize=7in vsize=7in; goptions border; ODS LISTING CLOSE; ODS HTML path=odsout body="&name..htm" (title="Color Blindness Test") style=htmlblue; goptions gunit=pct htitle=4 htext=2 ftitle="albany amt/bold" ftext="albany amt"; goptions ctext=gray33; title1 ls=1.5 "Color Blindness Test"; title2 h=3 ls=0.8 "Do you see a shape?"; title3 h=1 " "; footnote1 ls=1.5 "mouse over boxes to see hints"; /* colors in the ring */ pattern1 v=s c=cxf01100; /* red */ pattern2 v=s c=cxff8300; /* orange */ pattern3 v=s c=cxffca00; /* yellow */ /* normal/background/non-ring colors */ pattern4 v=s c=cx008c33; /* dark green */ pattern5 v=s c=cx3bc100; /* medium green */ pattern6 v=s c=cx83cf37; /* lighter green */ proc gmap data=color_data map=circular_map; id id; choro valcolor / discrete midpoints = 1 2 3 4 5 6 nolegend coutline=same html=my_html des='' name="&name"; run; /* colors in the ring */ pattern1 v=s c=cx5caeb9; /* darker blue */ pattern2 v=s c=cx8eb3c9; /* medium blue */ pattern3 v=s c=cx8dd7da; /* lighter blue */ /* normal/background/non-ring colors */ pattern4 v=s c=cx76de61; /* darker green */ pattern5 v=s c=cx13f3b6; /* medium green */ pattern6 v=s c=cxaef3c4; /* lighter green */ proc gmap data=color_data map=circular_map; id id; choro valcolor / discrete midpoints = 1 2 3 4 5 6 nolegend coutline=same html=my_html des='' name="&name"; run; /* colors in the ring */ pattern1 v=s c=cxfc9500; pattern2 v=s c=cxfc9500; pattern3 v=s c=cxfc9500; /* normal/background/non-ring colors */ pattern4 v=s c=cx609488; pattern5 v=s c=cx609488; pattern6 v=s c=cx609488; proc gmap data=color_data map=circular_map; id id; choro valcolor / discrete midpoints = 1 2 3 4 5 6 nolegend coutline=same html=my_html des='' name="&name"; run; /* colors in the ring */ pattern1 v=s c=gray55; pattern2 v=s c=gray99; pattern3 v=s c=graycc; /* normal/background/non-ring colors */ pattern4 v=s c=gray55; pattern5 v=s c=gray99; pattern6 v=s c=graycc; proc gmap data=color_data map=circular_map; id id; choro valcolor / discrete midpoints = 1 2 3 4 5 6 nolegend coutline=same html=my_html des='' name="&name"; run; quit; ODS HTML CLOSE; ODS LISTING;