data _null_;
/* Input values */
red=42;
green=31;
blue=170;
/* Convert to hex */
hexred=put(red,hex2.);
hexgreen=put(green,hex2.);
hexblue=put(blue,hex2.);
/* Create as a SAS RGB color */
sasrgb="CX"||hexred||hexgreen||hexblue;
/* Write the new value to the Log */
put sasrgb;
run;
博客展示了在SAS中进行颜色转换的代码。先输入RGB值,接着将红、绿、蓝值分别转换为十六进制,然后组合成SAS RGB颜色格式,最后将新值写入日志。
1万+

被折叠的 条评论
为什么被折叠?



