summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/asymptote/plain_pens.asy
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-02-28 18:48:48 +0000
committerKarl Berry <karl@freefriends.org>2019-02-28 18:48:48 +0000
commit3a9439b815af6c2d41c60f6694d88f2852544442 (patch)
tree6cc1c05e02ef84a1aeb2448b30814d7fc360ed9e /Master/texmf-dist/asymptote/plain_pens.asy
parent61a286ce26800c5976ff5c8c8795dc7eea404fd2 (diff)
asymptote 2.47 support files
git-svn-id: svn://tug.org/texlive/trunk@50168 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/asymptote/plain_pens.asy')
-rw-r--r--Master/texmf-dist/asymptote/plain_pens.asy8
1 files changed, 7 insertions, 1 deletions
diff --git a/Master/texmf-dist/asymptote/plain_pens.asy b/Master/texmf-dist/asymptote/plain_pens.asy
index 627ce2e8c84..22cf5ca4817 100644
--- a/Master/texmf-dist/asymptote/plain_pens.asy
+++ b/Master/texmf-dist/asymptote/plain_pens.asy
@@ -324,10 +324,16 @@ pen rgba(real[] a)
// Return a pen corresponding to a given 6-character RGB hexidecimal string.
pen rgb(string s)
{
- real value(string s, int i) {return hex(substr(s,2i,2))/255;}
+ int offset=substr(s,0,1) == '#' ? 1 : 0;
+ 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));
}
+pen RGB(int r, int g, int b)
+{
+ return rgb(r/255,g/255,b/255);
+}
+
pen[] operator +(pen[] a, pen b)
{
return sequence(new pen(int i) {return a[i]+b;},a.length);