git.shiar.nl
/
sheet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
611b97b
)
latin: generic function to display rgb colour svg
author
Mischa POSLAWSKY
<perl@shiar.org>
Wed, 12 Apr 2017 20:39:29 +0000
(22:39 +0200)
committer
Mischa POSLAWSKY
<perl@shiar.org>
Mon, 22 May 2017 15:55:29 +0000
(17:55 +0200)
writing-latn.inc.pl
patch
|
blob
|
history
diff --git
a/writing-latn.inc.pl
b/writing-latn.inc.pl
index 10b30cebe9c7ea67a19941cfb0e606125cdfb901..0d6ecb4d6305a0777b138481c7111ae7a25102c0 100644
(file)
--- a/
writing-latn.inc.pl
+++ b/
writing-latn.inc.pl
@@
-49,6
+49,18
@@
sub dispbar {
);
}
);
}
+sub disprgb {
+ my ($index) = @_;
+ my $circle = '<circle cx="%s" cy="%s" r="8" fill="#%X%X%X"/>';
+ return sprintf(
+ '<svg width="16" height="16" viewBox="0 0 22 22">%s</svg>',
+ join '',
+ sprintf($circle, 10, 10, [0, 8, 15]->[$index % 3], 0, 0),
+ sprintf($circle, 11, 12, 0, [0, 8, 15]->[$index / 3 % 3], 0),
+ sprintf($circle, 12, 10, 0, 0, [0, 8, 15]->[$index / 9]),
+ );
+}
+
(
uppercase => {
list => [qw{ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z }],
(
uppercase => {
list => [qw{ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z }],
@@
-454,16
+466,7
@@
rgbmap => {
'svg { isolation: isolate }',
'svg circle { mix-blend-mode: screen }',
],
'svg { isolation: isolate }',
'svg circle { mix-blend-mode: screen }',
],
- list => [
- map { '<svg width="16" height="16" viewBox="0 0 8 8">'.$_.'</svg>' }
- map {
- my $circle = '<circle cx="%s" cy="%s" r="8" fill="#%X%X%X"/>';
- join '',
- sprintf($circle, 0, 0, [0, 8, 15]->[$_ % 3], 0, 0),
- sprintf($circle, 8, 0, 0, [0, 8, 15]->[$_ / 3 % 3], 0),
- sprintf($circle, 6, 8, 0, 0, [0, 8, 15]->[$_ / 9]),
- } 1 .. 3*3*3
- ],
+ list => [ map { disprgb($_) } 0 .. 3*3*3 ],
},
dni => {
title => "D'ni",
},
dni => {
title => "D'ni",