"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "base/plain_pens.asy" between
asymptote-2.51.src.tgz and asymptote-2.52.src.tgz

About: Asymptote is a script-based vector graphics language for technical drawings.

plain_pens.asy  (asymptote-2.51.src.tgz):plain_pens.asy  (asymptote-2.52.src.tgz)
skipping to change at line 324 skipping to change at line 324
real[] a=colors(rgb(p)); real[] a=colors(rgb(p));
a.push(opacity(p)); a.push(opacity(p));
return a; return a;
} }
pen rgba(real[] a) pen rgba(real[] a)
{ {
return rgb(a[0],a[1],a[2])+opacity(a[3]); return rgb(a[0],a[1],a[2])+opacity(a[3]);
} }
// Return a pen corresponding to a given 6-character RGB hexidecimal string. // Return a pen corresponding to a given 6-character RGB hexadecimal string.
pen rgb(string s) pen rgb(string s)
{ {
int offset=substr(s,0,1) == '#' ? 1 : 0; int offset=substr(s,0,1) == '#' ? 1 : 0;
real value(string s, int i) {return hex(substr(s,2i+offset,2))/255;} real value(string s, int i) {return hex(substr(s,2i+offset,2))/255;}
return rgb(value(s,0),value(s,1),value(s,2)); return rgb(value(s,0),value(s,1),value(s,2));
} }
pen RGB(int r, int g, int b) pen RGB(int r, int g, int b)
{ {
return rgb(r/255,g/255,b/255); return rgb(r/255,g/255,b/255);
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)