-
Notifications
You must be signed in to change notification settings - Fork 6
/
space_view3d_screencast_keys.py
1284 lines (1180 loc) · 83.9 KB
/
space_view3d_screencast_keys.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
bl_info = {
"name": "Screencast Keys",
"author": "John E. Herreño",
"version": (2, 0), #Proof of Concept
"blender": (2, 66, 0),
"location": "3D View > Properties Panel > Screencast Keys",
"warning": "",
"description": "Display keys pressed in the 3D View, "
"useful for screencasts.",
"wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/"
"Py/Scripts/3D_interaction/Screencast_Key_Status_Tool",
"tracker_url": "http://projects.blender.org/tracker/index.php?"
"func=detail&aid=21612",
"category": "3D View"}
import bpy
import bgl
import blf
import time
import datetime
import pprint
import math
from mathutils import Vector
from mathutils.geometry import tessellate_polygon
class ScreenWidget:
_widget = []
_cache = []
_bounds = {}
#@TODO: support border mode for drawing
DRAW_MODE_BORDER = 2000
DRAW_MODE_FILLED = 2001
_draw_mode = 2001
def __init__(self, widget = None):
if widget is not None: self._widget = widget
pass
def draw_widget(self, size, offset, draw_mode = None):
chainedPolyLines, tess, bounds = self.get_widget()
bgl.glEnable(bgl.GL_BLEND)
bgl.glBegin(bgl.GL_TRIANGLES)
for i in tess:
bgl.glVertex2f(chainedPolyLines[i[0]][0]*size + offset[0], chainedPolyLines[i[0]][1]*size + offset[1])
bgl.glVertex2f(chainedPolyLines[i[1]][0]*size + offset[0], chainedPolyLines[i[1]][1]*size + offset[1])
bgl.glVertex2f(chainedPolyLines[i[2]][0]*size + offset[0], chainedPolyLines[i[2]][1]*size + offset[1])
bgl.glEnd()
return
#Draw the bounds (debug helper)
bgl.glColor4f(1.0, 0.0, 0.0, 0.05)
bgl.glBegin(bgl.GL_QUADS)
bgl.glVertex2f(bounds['min'].x*size + offset[0], bounds['min'].y*size + offset[1])
bgl.glVertex2f(bounds['min'].x*size + offset[0], bounds['max'].y*size + offset[1])
bgl.glVertex2f(bounds['max'].x*size + offset[0], bounds['max'].y*size + offset[1])
bgl.glVertex2f(bounds['max'].x*size + offset[0], bounds['min'].y*size + offset[1])
bgl.glEnd()
pass
def get_widget(self):
return self._tessellate_widget()
def get_bounds(self):
widget = self._tessellate_widget()
return self._bounds
def _tessellate_widget(self):
if len(self._cache) == 0:
polylines = []
for segments in self._widget:
polylines.append(self._segmentsToPolyline(segments, 12))
chainedPolyLines = []
for i in polylines:
for j in i:
chainedPolyLines.append(j)
tess = tessellate_polygon(polylines)
#Calc the bounds
xmin = xmax = chainedPolyLines[0].x
ymin = ymax = chainedPolyLines[0].y
for i in chainedPolyLines:
if i.x < xmin: xmin = i.x
if i.x > xmax: xmax = i.x
if i.y > ymax: ymax = i.y
if i.y < ymin: ymin = i.y
self._bounds = {'min': Vector([xmin, ymin]), 'max': Vector([xmax, ymax])}
self._cache = [chainedPolyLines, tess, self._bounds]
return self._cache
def _segmentsToPolyline(self, segments, resolution):
polyline = []
for i in segments:
#@TODO: implement adaptive generation of bezier curve
for step in range(resolution):
x, y = self.findPointInSegment(i, float(step)/float(resolution))
polyline.append(Vector([x, y]))
return polyline
def findPointInSegment(self, segment, t):
if len(segment) != 4:
raise "Bezier segment must have 4 coordinates"
p = segment
x = p[0][0]*math.pow(1 - t, 3) + 3*p[1][0]*t*math.pow(1 - t, 2) + 3*p[2][0]*t*t*(1 - t) + p[3][0]*math.pow(t, 3)
y = p[0][1]*math.pow(1 - t, 3) + 3*p[1][1]*t*math.pow(1 - t, 2) + 3*p[2][1]*t*t*(1 - t) + p[3][1]*math.pow(t, 3)
return [x, y]
class ScreenDisplay:
_actions_log = []
_id = 'Default'
def __init__(self, id, widgets):
if id is not None: self._id = id
self._actions_logger = Logger()
self._widgets = {}
for widget_id in widgets.keys():
self._widgets[widget_id] = ScreenWidget(widgets[widget_id])
self._offset = [0, 0]
self._size = 100
pass
def add_action(self, action):
self._actions_logger.add_log_event(action)
def draw_display(self):
print("="*20)
print("Drawing {} display. Actions logged:".format(self._id))
print(str(self._actions_logger))
def set_offset(self, offset):
if len(offset) != 2:
raise "Offset must be a list with 2 elements; x and y."
self._offset = offset
def set_size(self, size):
self._size = size
def calc_widget_screen_size(self, widget_name, scale):
#@TODO: raise error when widget not defined for current display
bounds = self._widgets[widget_name].get_bounds()
width = (bounds['max'].x - bounds['min'].x) * scale
height = (bounds['max'].y - bounds['min'].y) * scale
return {'width': width, 'height': height}
class MouseDisplay(ScreenDisplay):
_button_shapes = {
'LEFTMOUSE': [[[[-0.273, 0.152, 0.0], [-0.262, 0.172, 0.0], [-0.21, 0.256, 0.0], [-0.109, 0.294, 0.0]],
[[-0.109, 0.294, 0.0], [-0.123, 0.277, 0.0], [-0.109, 0.243, 0.0], [-0.09, 0.235, 0.0]],
[[-0.09, 0.235, 0.0], [-0.168, 0.201, 0.0], [-0.191, 0.166, 0.0], [-0.218, 0.123, 0.0]],
[[-0.218, 0.123, 0.0], [-0.242, 0.084, 0.0], [-0.297, 0.105, 0.0], [-0.273, 0.152, 0.0]]]],
'MIDDLEMOUSE': [[[[-0.067, 0.242, 0.0], [-0.04, 0.26, 0.0], [0.053, 0.255, 0.0], [0.066, 0.242, 0.0]],
[[0.066, 0.242, 0.0], [0.096, 0.256, 0.0], [0.099, 0.279, 0.0], [0.084, 0.301, 0.0]],
[[0.084, 0.301, 0.0], [0.058, 0.313, 0.0], [-0.044, 0.32, 0.0], [-0.085, 0.301, 0.0]],
[[-0.085, 0.301, 0.0], [-0.109, 0.281, 0.0], [-0.101, 0.245, 0.0], [-0.067, 0.242, 0.0]]]],
'RIGHTMOUSE': [[[[0.27, 0.157, 0.0], [0.256, 0.179, 0.0], [0.177, 0.269, 0.0], [0.1, 0.296, 0.0]],
[[0.1, 0.296, 0.0], [0.118, 0.273, 0.0], [0.102, 0.244, 0.0], [0.085, 0.237, 0.0]],
[[0.085, 0.237, 0.0], [0.146, 0.206, 0.0], [0.188, 0.169, 0.0], [0.216, 0.126, 0.0]],
[[0.216, 0.126, 0.0], [0.243, 0.084, 0.0], [0.3, 0.107, 0.0], [0.27, 0.157, 0.0]]]],
'WHEELUPMOUSE': [[[[-0.08, 0.312, 0.0], [-0.06, 0.378, 0.0], [-0.046, 0.385, 0.0], [-0.0, 0.423, 0.0]],
[[-0.0, 0.423, 0.0], [0.046, 0.385, 0.0], [0.06, 0.378, 0.0], [0.08, 0.312, 0.0]],
[[0.08, 0.312, 0.0], [0.034, 0.331, 0.0], [-0.035, 0.331, 0.0], [-0.08, 0.312, 0.0]]],
[[[-0.034, 0.344, 0.0], [-0.025, 0.372, 0.0], [-0.019, 0.375, 0.0], [-0.0, 0.391, 0.0]],
[[-0.0, 0.391, 0.0], [0.019, 0.375, 0.0], [0.025, 0.372, 0.0], [0.034, 0.344, 0.0]],
[[0.034, 0.344, 0.0], [0.014, 0.352, 0.0], [-0.015, 0.352, 0.0], [-0.034, 0.344, 0.0]]]],
'WHEELDOWNMOUSE': [[[[0.0, 0.137, 0.0], [-0.03, 0.163, 0.0], [-0.05, 0.179, 0.0], [-0.068, 0.227, 0.0]],
[[-0.068, 0.227, 0.0], [-0.037, 0.248, 0.0], [0.037, 0.248, 0.0], [0.068, 0.227, 0.0]],
[[0.068, 0.227, 0.0], [0.052, 0.179, 0.0], [0.03, 0.163, 0.0], [0.0, 0.137, 0.0]]]],
'CTRL': [[[[-0.271, -0.303, 0.000], [-0.310, -0.303, 0.000], [-0.314, -0.299, 0.000], [-0.314, -0.260, 0.000]],
[[-0.314, -0.260, 0.000], [-0.314, -0.236, 0.000], [-0.314, -0.212, 0.000], [-0.314, -0.187, 0.000]],
[[-0.314, -0.187, 0.000], [-0.314, -0.148, 0.000], [-0.310, -0.144, 0.000], [-0.271, -0.144, 0.000]],
[[-0.271, -0.144, 0.000], [-0.237, -0.144, 0.000], [-0.204, -0.144, 0.000], [-0.171, -0.144, 0.000]],
[[-0.171, -0.144, 0.000], [-0.131, -0.144, 0.000], [-0.127, -0.148, 0.000], [-0.127, -0.187, 0.000]],
[[-0.127, -0.187, 0.000], [-0.127, -0.212, 0.000], [-0.127, -0.236, 0.000], [-0.127, -0.260, 0.000]],
[[-0.127, -0.260, 0.000], [-0.127, -0.299, 0.000], [-0.131, -0.303, 0.000], [-0.171, -0.303, 0.000]],
[[-0.171, -0.303, 0.000], [-0.204, -0.303, 0.000], [-0.237, -0.303, 0.000], [-0.271, -0.303, 0.000]]],
[[[-0.262, -0.259, 0.000], [-0.258, -0.260, 0.000], [-0.253, -0.262, 0.000], [-0.248, -0.263, 0.000]],
[[-0.248, -0.263, 0.000], [-0.249, -0.267, 0.000], [-0.251, -0.270, 0.000], [-0.253, -0.273, 0.000]],
[[-0.253, -0.273, 0.000], [-0.255, -0.276, 0.000], [-0.257, -0.277, 0.000], [-0.260, -0.279, 0.000]],
[[-0.260, -0.279, 0.000], [-0.263, -0.280, 0.000], [-0.267, -0.281, 0.000], [-0.272, -0.281, 0.000]],
[[-0.272, -0.281, 0.000], [-0.277, -0.281, 0.000], [-0.282, -0.280, 0.000], [-0.285, -0.278, 0.000]],
[[-0.285, -0.278, 0.000], [-0.289, -0.277, 0.000], [-0.292, -0.274, 0.000], [-0.294, -0.270, 0.000]],
[[-0.294, -0.270, 0.000], [-0.297, -0.266, 0.000], [-0.298, -0.260, 0.000], [-0.298, -0.254, 0.000]],
[[-0.298, -0.254, 0.000], [-0.298, -0.246, 0.000], [-0.296, -0.239, 0.000], [-0.292, -0.234, 0.000]],
[[-0.292, -0.234, 0.000], [-0.287, -0.230, 0.000], [-0.281, -0.228, 0.000], [-0.272, -0.228, 0.000]],
[[-0.272, -0.228, 0.000], [-0.266, -0.228, 0.000], [-0.261, -0.229, 0.000], [-0.257, -0.231, 0.000]],
[[-0.257, -0.231, 0.000], [-0.253, -0.234, 0.000], [-0.251, -0.238, 0.000], [-0.249, -0.244, 0.000]],
[[-0.249, -0.244, 0.000], [-0.253, -0.245, 0.000], [-0.258, -0.246, 0.000], [-0.263, -0.247, 0.000]],
[[-0.263, -0.247, 0.000], [-0.263, -0.245, 0.000], [-0.264, -0.244, 0.000], [-0.264, -0.243, 0.000]],
[[-0.264, -0.243, 0.000], [-0.265, -0.242, 0.000], [-0.266, -0.241, 0.000], [-0.268, -0.240, 0.000]],
[[-0.268, -0.240, 0.000], [-0.269, -0.240, 0.000], [-0.270, -0.239, 0.000], [-0.272, -0.239, 0.000]],
[[-0.272, -0.239, 0.000], [-0.276, -0.239, 0.000], [-0.278, -0.241, 0.000], [-0.280, -0.244, 0.000]],
[[-0.280, -0.244, 0.000], [-0.282, -0.246, 0.000], [-0.282, -0.249, 0.000], [-0.282, -0.254, 0.000]],
[[-0.282, -0.254, 0.000], [-0.282, -0.260, 0.000], [-0.282, -0.264, 0.000], [-0.280, -0.266, 0.000]],
[[-0.280, -0.266, 0.000], [-0.278, -0.268, 0.000], [-0.276, -0.269, 0.000], [-0.272, -0.269, 0.000]],
[[-0.272, -0.269, 0.000], [-0.269, -0.269, 0.000], [-0.267, -0.268, 0.000], [-0.266, -0.266, 0.000]],
[[-0.266, -0.266, 0.000], [-0.264, -0.265, 0.000], [-0.263, -0.262, 0.000], [-0.262, -0.259, 0.000]]],
[[[-0.224, -0.228, 0.000], [-0.224, -0.233, 0.000], [-0.224, -0.238, 0.000], [-0.224, -0.243, 0.000]],
[[-0.224, -0.243, 0.000], [-0.222, -0.243, 0.000], [-0.219, -0.243, 0.000], [-0.216, -0.243, 0.000]],
[[-0.216, -0.243, 0.000], [-0.216, -0.246, 0.000], [-0.216, -0.250, 0.000], [-0.216, -0.253, 0.000]],
[[-0.216, -0.253, 0.000], [-0.219, -0.253, 0.000], [-0.222, -0.253, 0.000], [-0.224, -0.253, 0.000]],
[[-0.224, -0.253, 0.000], [-0.224, -0.257, 0.000], [-0.224, -0.262, 0.000], [-0.224, -0.266, 0.000]],
[[-0.224, -0.266, 0.000], [-0.224, -0.268, 0.000], [-0.224, -0.269, 0.000], [-0.224, -0.269, 0.000]],
[[-0.224, -0.269, 0.000], [-0.223, -0.270, 0.000], [-0.222, -0.271, 0.000], [-0.221, -0.271, 0.000]],
[[-0.221, -0.271, 0.000], [-0.220, -0.271, 0.000], [-0.219, -0.270, 0.000], [-0.217, -0.270, 0.000]],
[[-0.217, -0.270, 0.000], [-0.217, -0.273, 0.000], [-0.216, -0.276, 0.000], [-0.216, -0.280, 0.000]],
[[-0.216, -0.280, 0.000], [-0.219, -0.280, 0.000], [-0.223, -0.281, 0.000], [-0.226, -0.281, 0.000]],
[[-0.226, -0.281, 0.000], [-0.229, -0.281, 0.000], [-0.232, -0.280, 0.000], [-0.234, -0.279, 0.000]],
[[-0.234, -0.279, 0.000], [-0.235, -0.278, 0.000], [-0.237, -0.277, 0.000], [-0.237, -0.275, 0.000]],
[[-0.237, -0.275, 0.000], [-0.238, -0.273, 0.000], [-0.239, -0.270, 0.000], [-0.239, -0.266, 0.000]],
[[-0.239, -0.266, 0.000], [-0.239, -0.262, 0.000], [-0.239, -0.257, 0.000], [-0.239, -0.253, 0.000]],
[[-0.239, -0.253, 0.000], [-0.240, -0.253, 0.000], [-0.242, -0.253, 0.000], [-0.244, -0.253, 0.000]],
[[-0.244, -0.253, 0.000], [-0.244, -0.250, 0.000], [-0.244, -0.246, 0.000], [-0.244, -0.243, 0.000]],
[[-0.244, -0.243, 0.000], [-0.242, -0.243, 0.000], [-0.240, -0.243, 0.000], [-0.239, -0.243, 0.000]],
[[-0.239, -0.243, 0.000], [-0.239, -0.240, 0.000], [-0.239, -0.238, 0.000], [-0.239, -0.236, 0.000]],
[[-0.239, -0.236, 0.000], [-0.234, -0.233, 0.000], [-0.229, -0.231, 0.000], [-0.224, -0.228, 0.000]]],
[[[-0.209, -0.243, 0.000], [-0.205, -0.243, 0.000], [-0.200, -0.243, 0.000], [-0.196, -0.243, 0.000]],
[[-0.196, -0.243, 0.000], [-0.196, -0.245, 0.000], [-0.196, -0.247, 0.000], [-0.196, -0.249, 0.000]],
[[-0.196, -0.249, 0.000], [-0.195, -0.246, 0.000], [-0.193, -0.244, 0.000], [-0.192, -0.243, 0.000]],
[[-0.192, -0.243, 0.000], [-0.191, -0.242, 0.000], [-0.189, -0.242, 0.000], [-0.187, -0.242, 0.000]],
[[-0.187, -0.242, 0.000], [-0.185, -0.242, 0.000], [-0.183, -0.242, 0.000], [-0.180, -0.244, 0.000]],
[[-0.180, -0.244, 0.000], [-0.182, -0.247, 0.000], [-0.183, -0.251, 0.000], [-0.184, -0.254, 0.000]],
[[-0.184, -0.254, 0.000], [-0.186, -0.253, 0.000], [-0.187, -0.253, 0.000], [-0.188, -0.253, 0.000]],
[[-0.188, -0.253, 0.000], [-0.190, -0.253, 0.000], [-0.192, -0.254, 0.000], [-0.193, -0.255, 0.000]],
[[-0.193, -0.255, 0.000], [-0.194, -0.257, 0.000], [-0.195, -0.261, 0.000], [-0.195, -0.267, 0.000]],
[[-0.195, -0.267, 0.000], [-0.195, -0.272, 0.000], [-0.195, -0.276, 0.000], [-0.195, -0.280, 0.000]],
[[-0.195, -0.280, 0.000], [-0.200, -0.280, 0.000], [-0.205, -0.280, 0.000], [-0.209, -0.280, 0.000]],
[[-0.209, -0.280, 0.000], [-0.209, -0.267, 0.000], [-0.209, -0.255, 0.000], [-0.209, -0.243, 0.000]]],
[[[-0.177, -0.228, 0.000], [-0.172, -0.228, 0.000], [-0.168, -0.228, 0.000], [-0.163, -0.228, 0.000]],
[[-0.163, -0.228, 0.000], [-0.163, -0.246, 0.000], [-0.163, -0.263, 0.000], [-0.163, -0.280, 0.000]],
[[-0.163, -0.280, 0.000], [-0.168, -0.280, 0.000], [-0.172, -0.280, 0.000], [-0.177, -0.280, 0.000]],
[[-0.177, -0.280, 0.000], [-0.177, -0.263, 0.000], [-0.177, -0.246, 0.000], [-0.177, -0.228, 0.000]]]],
'ALT': [[[[-0.055, -0.303, 0.000], [-0.094, -0.303, 0.000], [-0.098, -0.299, 0.000], [-0.098, -0.260, 0.000]],
[[-0.098, -0.260, 0.000], [-0.098, -0.236, 0.000], [-0.098, -0.212, 0.000], [-0.098, -0.187, 0.000]],
[[-0.098, -0.187, 0.000], [-0.098, -0.148, 0.000], [-0.094, -0.144, 0.000], [-0.055, -0.144, 0.000]],
[[-0.055, -0.144, 0.000], [-0.022, -0.144, 0.000], [0.012, -0.144, 0.000], [0.045, -0.144, 0.000]],
[[0.045, -0.144, 0.000], [0.085, -0.144, 0.000], [0.088, -0.148, 0.000], [0.088, -0.187, 0.000]],
[[0.088, -0.187, 0.000], [0.088, -0.212, 0.000], [0.088, -0.236, 0.000], [0.088, -0.260, 0.000]],
[[0.088, -0.260, 0.000], [0.088, -0.299, 0.000], [0.085, -0.303, 0.000], [0.045, -0.303, 0.000]],
[[0.045, -0.303, 0.000], [0.012, -0.303, 0.000], [-0.022, -0.303, 0.000], [-0.055, -0.303, 0.000]]],
[[[-0.038, -0.270, 0.000], [-0.044, -0.270, 0.000], [-0.051, -0.270, 0.000], [-0.057, -0.270, 0.000]],
[[-0.057, -0.270, 0.000], [-0.057, -0.273, 0.000], [-0.058, -0.276, 0.000], [-0.059, -0.278, 0.000]],
[[-0.059, -0.278, 0.000], [-0.064, -0.278, 0.000], [-0.070, -0.278, 0.000], [-0.075, -0.278, 0.000]],
[[-0.075, -0.278, 0.000], [-0.069, -0.261, 0.000], [-0.062, -0.244, 0.000], [-0.056, -0.227, 0.000]],
[[-0.056, -0.227, 0.000], [-0.050, -0.227, 0.000], [-0.044, -0.227, 0.000], [-0.039, -0.227, 0.000]],
[[-0.039, -0.227, 0.000], [-0.032, -0.244, 0.000], [-0.026, -0.261, 0.000], [-0.019, -0.278, 0.000]],
[[-0.019, -0.278, 0.000], [-0.025, -0.278, 0.000], [-0.030, -0.278, 0.000], [-0.036, -0.278, 0.000]],
[[-0.036, -0.278, 0.000], [-0.037, -0.276, 0.000], [-0.038, -0.273, 0.000], [-0.038, -0.270, 0.000]]],
[[[-0.042, -0.259, 0.000], [-0.044, -0.253, 0.000], [-0.046, -0.246, 0.000], [-0.047, -0.240, 0.000]],
[[-0.047, -0.240, 0.000], [-0.049, -0.246, 0.000], [-0.051, -0.253, 0.000], [-0.053, -0.259, 0.000]],
[[-0.053, -0.259, 0.000], [-0.049, -0.259, 0.000], [-0.046, -0.259, 0.000], [-0.042, -0.259, 0.000]]],
[[[-0.015, -0.227, 0.000], [-0.010, -0.227, 0.000], [-0.005, -0.227, 0.000], [-0.000, -0.227, 0.000]],
[[-0.000, -0.227, 0.000], [-0.000, -0.244, 0.000], [-0.000, -0.261, 0.000], [-0.000, -0.278, 0.000]],
[[-0.000, -0.278, 0.000], [-0.005, -0.278, 0.000], [-0.010, -0.278, 0.000], [-0.015, -0.278, 0.000]],
[[-0.015, -0.278, 0.000], [-0.015, -0.261, 0.000], [-0.015, -0.244, 0.000], [-0.015, -0.227, 0.000]]],
[[[0.026, -0.227, 0.000], [0.026, -0.232, 0.000], [0.026, -0.236, 0.000], [0.026, -0.241, 0.000]],
[[0.026, -0.241, 0.000], [0.029, -0.241, 0.000], [0.031, -0.241, 0.000], [0.034, -0.241, 0.000]],
[[0.034, -0.241, 0.000], [0.034, -0.245, 0.000], [0.034, -0.248, 0.000], [0.034, -0.252, 0.000]],
[[0.034, -0.252, 0.000], [0.031, -0.252, 0.000], [0.029, -0.252, 0.000], [0.026, -0.252, 0.000]],
[[0.026, -0.252, 0.000], [0.026, -0.256, 0.000], [0.026, -0.260, 0.000], [0.026, -0.265, 0.000]],
[[0.026, -0.265, 0.000], [0.026, -0.266, 0.000], [0.026, -0.267, 0.000], [0.027, -0.268, 0.000]],
[[0.027, -0.268, 0.000], [0.027, -0.269, 0.000], [0.028, -0.269, 0.000], [0.029, -0.269, 0.000]],
[[0.029, -0.269, 0.000], [0.030, -0.269, 0.000], [0.032, -0.269, 0.000], [0.033, -0.268, 0.000]],
[[0.033, -0.268, 0.000], [0.034, -0.272, 0.000], [0.034, -0.275, 0.000], [0.035, -0.278, 0.000]],
[[0.035, -0.278, 0.000], [0.031, -0.279, 0.000], [0.028, -0.279, 0.000], [0.025, -0.279, 0.000]],
[[0.025, -0.279, 0.000], [0.021, -0.279, 0.000], [0.018, -0.279, 0.000], [0.017, -0.278, 0.000]],
[[0.017, -0.278, 0.000], [0.015, -0.277, 0.000], [0.014, -0.276, 0.000], [0.013, -0.274, 0.000]],
[[0.013, -0.274, 0.000], [0.012, -0.272, 0.000], [0.012, -0.269, 0.000], [0.012, -0.265, 0.000]],
[[0.012, -0.265, 0.000], [0.012, -0.260, 0.000], [0.012, -0.256, 0.000], [0.012, -0.252, 0.000]],
[[0.012, -0.252, 0.000], [0.010, -0.252, 0.000], [0.008, -0.252, 0.000], [0.007, -0.252, 0.000]],
[[0.007, -0.252, 0.000], [0.007, -0.248, 0.000], [0.007, -0.245, 0.000], [0.007, -0.241, 0.000]],
[[0.007, -0.241, 0.000], [0.008, -0.241, 0.000], [0.010, -0.241, 0.000], [0.012, -0.241, 0.000]],
[[0.012, -0.241, 0.000], [0.012, -0.239, 0.000], [0.012, -0.237, 0.000], [0.012, -0.234, 0.000]],
[[0.012, -0.234, 0.000], [0.017, -0.232, 0.000], [0.021, -0.229, 0.000], [0.026, -0.227, 0.000]]]],
'SHIFT': [[[[0.164, -0.303, 0.000], [0.125, -0.303, 0.000], [0.121, -0.299, 0.000], [0.121, -0.260, 0.000]],
[[0.121, -0.260, 0.000], [0.121, -0.236, 0.000], [0.121, -0.212, 0.000], [0.121, -0.187, 0.000]],
[[0.121, -0.187, 0.000], [0.121, -0.148, 0.000], [0.125, -0.144, 0.000], [0.164, -0.144, 0.000]],
[[0.164, -0.144, 0.000], [0.203, -0.144, 0.000], [0.242, -0.144, 0.000], [0.282, -0.144, 0.000]],
[[0.282, -0.144, 0.000], [0.321, -0.144, 0.000], [0.325, -0.148, 0.000], [0.325, -0.187, 0.000]],
[[0.325, -0.187, 0.000], [0.325, -0.212, 0.000], [0.325, -0.236, 0.000], [0.325, -0.260, 0.000]],
[[0.325, -0.260, 0.000], [0.325, -0.299, 0.000], [0.321, -0.303, 0.000], [0.282, -0.303, 0.000]],
[[0.282, -0.303, 0.000], [0.242, -0.303, 0.000], [0.203, -0.303, 0.000], [0.164, -0.303, 0.000]]],
[[[0.206, -0.280, 0.000], [0.192, -0.280, 0.000], [0.179, -0.280, 0.000], [0.165, -0.280, 0.000]],
[[0.165, -0.280, 0.000], [0.165, -0.268, 0.000], [0.165, -0.256, 0.000], [0.165, -0.244, 0.000]],
[[0.165, -0.244, 0.000], [0.162, -0.244, 0.000], [0.153, -0.244, 0.000], [0.146, -0.244, 0.000]],
[[0.146, -0.244, 0.000], [0.159, -0.231, 0.000], [0.172, -0.217, 0.000], [0.186, -0.204, 0.000]],
[[0.186, -0.204, 0.000], [0.199, -0.217, 0.000], [0.212, -0.231, 0.000], [0.225, -0.244, 0.000]],
[[0.225, -0.244, 0.000], [0.218, -0.244, 0.000], [0.210, -0.244, 0.000], [0.206, -0.244, 0.000]],
[[0.206, -0.244, 0.000], [0.206, -0.256, 0.000], [0.206, -0.268, 0.000], [0.206, -0.280, 0.000]]]],
}
def __init__(self):
super(MouseDisplay, self).__init__('Mouse', self._button_shapes)
self._detector = MouseActionDetector()
self.set_size(300)
pass
def process_event(self, event):
#Update offset
offset = [event.mouse_region_x, event.mouse_region_y]
self.set_offset(offset)
#Check for action
act = self._detector.detect_action(event)
if act:
self.process_action(act)
def process_action(self, action):
if action.device == 'Mouse':
self.add_action(action)
def draw_display(self):
super(MouseDisplay, self).draw_display()
recent_log_events = self._actions_logger.get_recent_events(4.5)
cur_time = time.time()
#actions.reverse()
bgl.glEnable(bgl.GL_BLEND)
for widget_id in self._widgets:
alpha = 0.025
for log_event in recent_log_events[0:-1]:
action = log_event.get_content()
if action.type == widget_id or action.ctrl and widget_id == 'CTRL' or action.alt and widget_id == 'ALT' or action.shift and widget_id == 'SHIFT':
#Use logistic function to calculate alpha
#Clamp to 25% max for all but latest action
alpha = 0.125 - 0.125 / (1 + math.exp(-6 * (cur_time - log_event.timestamp - 3.0))) #(1.0 - (cur_time - log_event.timestamp)) / 1.0
log_event = recent_log_events[-1] if len(recent_log_events) else None
action = log_event.get_content() if log_event else None
if action:
if action.type == widget_id or action.ctrl and widget_id == 'CTRL' or action.alt and widget_id == 'ALT' or action.shift and widget_id == 'SHIFT':
#Use logistic function to calculate alpha
alpha = .5 - .5 / (1 + math.exp(-6 * (cur_time - log_event.timestamp - 3.0))) #(3.0 - (cur_time - log_event.timestamp)) / 3.0
if alpha < 0.025: alpha = 0.025
bgl.glColor4f(1.0, 1.0, 1.0, alpha)
self._widgets[widget_id].draw_widget(self._size, self._offset)
class KeyboardDisplay(ScreenDisplay):
_keys_shapes = {
'A': [[[[0.717, 0.165, 0.000], [0.600, 0.165, 0.000], [0.482, 0.165, 0.000], [0.365, 0.165, 0.000]],
[[0.365, 0.165, 0.000], [0.349, 0.110, 0.000], [0.333, 0.055, 0.000], [0.317, 0.000, 0.000]],
[[0.317, 0.000, 0.000], [0.212, 0.000, 0.000], [0.107, 0.000, 0.000], [0.001, 0.000, 0.000]],
[[0.001, 0.000, 0.000], [0.127, 0.333, 0.000], [0.252, 0.666, 0.000], [0.377, 0.999, 0.000]],
[[0.377, 0.999, 0.000], [0.489, 0.999, 0.000], [0.601, 0.999, 0.000], [0.713, 0.999, 0.000]],
[[0.713, 0.999, 0.000], [0.839, 0.666, 0.000], [0.964, 0.333, 0.000], [1.089, 0.000, 0.000]],
[[1.089, 0.000, 0.000], [0.981, 0.000, 0.000], [0.874, 0.000, 0.000], [0.766, 0.000, 0.000]],
[[0.766, 0.000, 0.000], [0.750, 0.055, 0.000], [0.733, 0.110, 0.000], [0.717, 0.165, 0.000]]],
[[[0.652, 0.381, 0.000], [0.615, 0.501, 0.000], [0.579, 0.620, 0.000], [0.542, 0.740, 0.000]],
[[0.542, 0.740, 0.000], [0.505, 0.620, 0.000], [0.469, 0.501, 0.000], [0.432, 0.381, 0.000]],
[[0.432, 0.381, 0.000], [0.505, 0.381, 0.000], [0.579, 0.381, 0.000], [0.652, 0.381, 0.000]]]],
'B': [[[[-0.000, 0.999, 0.000], [0.193, 0.999, 0.000], [0.385, 0.999, 0.000], [0.578, 0.999, 0.000]],
[[0.578, 0.999, 0.000], [0.674, 0.999, 0.000], [0.748, 0.975, 0.000], [0.800, 0.927, 0.000]],
[[0.800, 0.927, 0.000], [0.851, 0.880, 0.000], [0.877, 0.821, 0.000], [0.877, 0.750, 0.000]],
[[0.877, 0.750, 0.000], [0.877, 0.691, 0.000], [0.859, 0.641, 0.000], [0.822, 0.598, 0.000]],
[[0.822, 0.598, 0.000], [0.797, 0.570, 0.000], [0.761, 0.548, 0.000], [0.714, 0.532, 0.000]],
[[0.714, 0.532, 0.000], [0.786, 0.514, 0.000], [0.839, 0.485, 0.000], [0.873, 0.443, 0.000]],
[[0.873, 0.443, 0.000], [0.906, 0.401, 0.000], [0.923, 0.348, 0.000], [0.923, 0.284, 0.000]],
[[0.923, 0.284, 0.000], [0.923, 0.232, 0.000], [0.911, 0.186, 0.000], [0.887, 0.144, 0.000]],
[[0.887, 0.144, 0.000], [0.863, 0.103, 0.000], [0.830, 0.070, 0.000], [0.788, 0.046, 0.000]],
[[0.788, 0.046, 0.000], [0.762, 0.031, 0.000], [0.723, 0.020, 0.000], [0.671, 0.014, 0.000]],
[[0.671, 0.014, 0.000], [0.602, 0.005, 0.000], [0.556, 0.000, 0.000], [0.533, 0.000, 0.000]],
[[0.533, 0.000, 0.000], [0.355, 0.000, 0.000], [0.178, 0.000, 0.000], [-0.000, 0.000, 0.000]],
[[-0.000, 0.000, 0.000], [-0.000, 0.333, 0.000], [-0.000, 0.666, 0.000], [-0.000, 0.999, 0.000]]],
[[[0.311, 0.607, 0.000], [0.356, 0.607, 0.000], [0.401, 0.607, 0.000], [0.446, 0.607, 0.000]],
[[0.446, 0.607, 0.000], [0.494, 0.607, 0.000], [0.527, 0.615, 0.000], [0.546, 0.632, 0.000]],
[[0.546, 0.632, 0.000], [0.565, 0.649, 0.000], [0.574, 0.673, 0.000], [0.574, 0.704, 0.000]],
[[0.574, 0.704, 0.000], [0.574, 0.733, 0.000], [0.565, 0.756, 0.000], [0.546, 0.772, 0.000]],
[[0.546, 0.772, 0.000], [0.527, 0.788, 0.000], [0.494, 0.797, 0.000], [0.448, 0.797, 0.000]],
[[0.448, 0.797, 0.000], [0.402, 0.797, 0.000], [0.357, 0.797, 0.000], [0.311, 0.797, 0.000]],
[[0.311, 0.797, 0.000], [0.311, 0.733, 0.000], [0.311, 0.670, 0.000], [0.311, 0.607, 0.000]]],
[[[0.311, 0.215, 0.000], [0.364, 0.215, 0.000], [0.416, 0.215, 0.000], [0.469, 0.215, 0.000]],
[[0.469, 0.215, 0.000], [0.522, 0.215, 0.000], [0.559, 0.224, 0.000], [0.581, 0.243, 0.000]],
[[0.581, 0.243, 0.000], [0.603, 0.262, 0.000], [0.614, 0.287, 0.000], [0.614, 0.319, 0.000]],
[[0.614, 0.319, 0.000], [0.614, 0.348, 0.000], [0.603, 0.372, 0.000], [0.582, 0.390, 0.000]],
[[0.582, 0.390, 0.000], [0.560, 0.408, 0.000], [0.522, 0.417, 0.000], [0.468, 0.417, 0.000]],
[[0.468, 0.417, 0.000], [0.416, 0.417, 0.000], [0.364, 0.417, 0.000], [0.311, 0.417, 0.000]],
[[0.311, 0.417, 0.000], [0.311, 0.350, 0.000], [0.311, 0.282, 0.000], [0.311, 0.215, 0.000]]]],
'C': [[[[0.701, 0.408, 0.000], [0.791, 0.381, 0.000], [0.882, 0.354, 0.000], [0.972, 0.326, 0.000]],
[[0.972, 0.326, 0.000], [0.954, 0.251, 0.000], [0.925, 0.187, 0.000], [0.886, 0.136, 0.000]],
[[0.886, 0.136, 0.000], [0.847, 0.085, 0.000], [0.798, 0.047, 0.000], [0.740, 0.021, 0.000]],
[[0.740, 0.021, 0.000], [0.682, -0.005, 0.000], [0.609, -0.018, 0.000], [0.519, -0.018, 0.000]],
[[0.519, -0.018, 0.000], [0.411, -0.018, 0.000], [0.322, -0.002, 0.000], [0.253, 0.030, 0.000]],
[[0.253, 0.030, 0.000], [0.184, 0.061, 0.000], [0.125, 0.117, 0.000], [0.075, 0.196, 0.000]],
[[0.075, 0.196, 0.000], [0.025, 0.276, 0.000], [-0.000, 0.378, 0.000], [-0.000, 0.502, 0.000]],
[[-0.000, 0.502, 0.000], [-0.000, 0.667, 0.000], [0.044, 0.794, 0.000], [0.132, 0.883, 0.000]],
[[0.132, 0.883, 0.000], [0.220, 0.972, 0.000], [0.344, 1.016, 0.000], [0.505, 1.016, 0.000]],
[[0.505, 1.016, 0.000], [0.631, 1.016, 0.000], [0.730, 0.991, 0.000], [0.802, 0.940, 0.000]],
[[0.802, 0.940, 0.000], [0.874, 0.889, 0.000], [0.927, 0.811, 0.000], [0.962, 0.705, 0.000]],
[[0.962, 0.705, 0.000], [0.871, 0.685, 0.000], [0.780, 0.665, 0.000], [0.690, 0.645, 0.000]],
[[0.690, 0.645, 0.000], [0.680, 0.675, 0.000], [0.670, 0.697, 0.000], [0.660, 0.711, 0.000]],
[[0.660, 0.711, 0.000], [0.642, 0.735, 0.000], [0.621, 0.753, 0.000], [0.596, 0.766, 0.000]],
[[0.596, 0.766, 0.000], [0.571, 0.779, 0.000], [0.543, 0.785, 0.000], [0.512, 0.785, 0.000]],
[[0.512, 0.785, 0.000], [0.442, 0.785, 0.000], [0.389, 0.757, 0.000], [0.352, 0.700, 0.000]],
[[0.352, 0.700, 0.000], [0.323, 0.659, 0.000], [0.309, 0.593, 0.000], [0.309, 0.504, 0.000]],
[[0.309, 0.504, 0.000], [0.309, 0.393, 0.000], [0.326, 0.317, 0.000], [0.360, 0.276, 0.000]],
[[0.360, 0.276, 0.000], [0.393, 0.235, 0.000], [0.441, 0.214, 0.000], [0.502, 0.214, 0.000]],
[[0.502, 0.214, 0.000], [0.561, 0.214, 0.000], [0.605, 0.231, 0.000], [0.635, 0.264, 0.000]],
[[0.635, 0.264, 0.000], [0.666, 0.297, 0.000], [0.688, 0.345, 0.000], [0.701, 0.408, 0.000]]]],
'D': [[[[0.000, 0.999, 0.000], [0.153, 0.999, 0.000], [0.306, 0.999, 0.000], [0.459, 0.999, 0.000]],
[[0.459, 0.999, 0.000], [0.549, 0.999, 0.000], [0.622, 0.987, 0.000], [0.678, 0.962, 0.000]],
[[0.678, 0.962, 0.000], [0.733, 0.938, 0.000], [0.779, 0.902, 0.000], [0.816, 0.857, 0.000]],
[[0.816, 0.857, 0.000], [0.852, 0.811, 0.000], [0.878, 0.757, 0.000], [0.895, 0.696, 0.000]],
[[0.895, 0.696, 0.000], [0.911, 0.636, 0.000], [0.919, 0.571, 0.000], [0.919, 0.503, 0.000]],
[[0.919, 0.503, 0.000], [0.919, 0.396, 0.000], [0.907, 0.313, 0.000], [0.883, 0.255, 0.000]],
[[0.883, 0.255, 0.000], [0.858, 0.196, 0.000], [0.825, 0.146, 0.000], [0.782, 0.107, 0.000]],
[[0.782, 0.107, 0.000], [0.738, 0.067, 0.000], [0.692, 0.040, 0.000], [0.643, 0.027, 0.000]],
[[0.643, 0.027, 0.000], [0.575, 0.009, 0.000], [0.514, 0.000, 0.000], [0.459, 0.000, 0.000]],
[[0.459, 0.000, 0.000], [0.306, 0.000, 0.000], [0.153, 0.000, 0.000], [0.000, 0.000, 0.000]],
[[0.000, 0.000, 0.000], [0.000, 0.333, 0.000], [0.000, 0.666, 0.000], [0.000, 0.999, 0.000]]],
[[[0.309, 0.773, 0.000], [0.309, 0.591, 0.000], [0.309, 0.409, 0.000], [0.309, 0.227, 0.000]],
[[0.309, 0.227, 0.000], [0.334, 0.227, 0.000], [0.359, 0.227, 0.000], [0.384, 0.227, 0.000]],
[[0.384, 0.227, 0.000], [0.449, 0.227, 0.000], [0.495, 0.234, 0.000], [0.522, 0.248, 0.000]],
[[0.522, 0.248, 0.000], [0.549, 0.263, 0.000], [0.571, 0.288, 0.000], [0.586, 0.323, 0.000]],
[[0.586, 0.323, 0.000], [0.601, 0.359, 0.000], [0.609, 0.417, 0.000], [0.609, 0.497, 0.000]],
[[0.609, 0.497, 0.000], [0.609, 0.603, 0.000], [0.592, 0.675, 0.000], [0.557, 0.714, 0.000]],
[[0.557, 0.714, 0.000], [0.523, 0.753, 0.000], [0.466, 0.773, 0.000], [0.386, 0.773, 0.000]],
[[0.386, 0.773, 0.000], [0.360, 0.773, 0.000], [0.334, 0.773, 0.000], [0.309, 0.773, 0.000]]]],
'E': [[[[-0.000, 0.999, 0.000], [0.276, 0.999, 0.000], [0.551, 0.999, 0.000], [0.827, 0.999, 0.000]],
[[0.827, 0.999, 0.000], [0.827, 0.928, 0.000], [0.827, 0.857, 0.000], [0.827, 0.786, 0.000]],
[[0.827, 0.786, 0.000], [0.655, 0.786, 0.000], [0.482, 0.786, 0.000], [0.309, 0.786, 0.000]],
[[0.309, 0.786, 0.000], [0.309, 0.733, 0.000], [0.309, 0.680, 0.000], [0.309, 0.627, 0.000]],
[[0.309, 0.627, 0.000], [0.469, 0.627, 0.000], [0.630, 0.627, 0.000], [0.790, 0.627, 0.000]],
[[0.790, 0.627, 0.000], [0.790, 0.559, 0.000], [0.790, 0.491, 0.000], [0.790, 0.423, 0.000]],
[[0.790, 0.423, 0.000], [0.630, 0.423, 0.000], [0.469, 0.423, 0.000], [0.309, 0.423, 0.000]],
[[0.309, 0.423, 0.000], [0.309, 0.358, 0.000], [0.309, 0.292, 0.000], [0.309, 0.226, 0.000]],
[[0.309, 0.226, 0.000], [0.487, 0.226, 0.000], [0.665, 0.226, 0.000], [0.842, 0.226, 0.000]],
[[0.842, 0.226, 0.000], [0.842, 0.151, 0.000], [0.842, 0.075, 0.000], [0.842, 0.000, 0.000]],
[[0.842, 0.000, 0.000], [0.561, 0.000, 0.000], [0.281, 0.000, 0.000], [-0.000, 0.000, 0.000]],
[[-0.000, 0.000, 0.000], [-0.000, 0.333, 0.000], [-0.000, 0.666, 0.000], [-0.000, 0.999, 0.000]]]],
'F': [[[[-0.000, 0.999, 0.000], [0.254, 0.999, 0.000], [0.509, 0.999, 0.000], [0.763, 0.999, 0.000]],
[[0.763, 0.999, 0.000], [0.763, 0.927, 0.000], [0.763, 0.856, 0.000], [0.763, 0.784, 0.000]],
[[0.763, 0.784, 0.000], [0.612, 0.784, 0.000], [0.461, 0.784, 0.000], [0.310, 0.784, 0.000]],
[[0.310, 0.784, 0.000], [0.310, 0.726, 0.000], [0.310, 0.668, 0.000], [0.310, 0.610, 0.000]],
[[0.310, 0.610, 0.000], [0.439, 0.610, 0.000], [0.568, 0.610, 0.000], [0.697, 0.610, 0.000]],
[[0.697, 0.610, 0.000], [0.697, 0.543, 0.000], [0.697, 0.475, 0.000], [0.697, 0.408, 0.000]],
[[0.697, 0.408, 0.000], [0.568, 0.408, 0.000], [0.439, 0.408, 0.000], [0.310, 0.408, 0.000]],
[[0.310, 0.408, 0.000], [0.310, 0.272, 0.000], [0.310, 0.136, 0.000], [0.310, 0.000, 0.000]],
[[0.310, 0.000, 0.000], [0.207, 0.000, 0.000], [0.103, 0.000, 0.000], [-0.000, 0.000, 0.000]],
[[-0.000, 0.000, 0.000], [-0.000, 0.333, 0.000], [-0.000, 0.666, 0.000], [-0.000, 0.999, 0.000]]]],
'G': [[[[0.540, 0.362, 0.000], [0.540, 0.431, 0.000], [0.540, 0.500, 0.000], [0.540, 0.570, 0.000]],
[[0.540, 0.570, 0.000], [0.699, 0.570, 0.000], [0.858, 0.570, 0.000], [1.017, 0.570, 0.000]],
[[1.017, 0.570, 0.000], [1.017, 0.428, 0.000], [1.017, 0.286, 0.000], [1.017, 0.144, 0.000]],
[[1.017, 0.144, 0.000], [0.926, 0.082, 0.000], [0.845, 0.039, 0.000], [0.775, 0.017, 0.000]],
[[0.775, 0.017, 0.000], [0.705, -0.006, 0.000], [0.622, -0.017, 0.000], [0.525, -0.017, 0.000]],
[[0.525, -0.017, 0.000], [0.407, -0.017, 0.000], [0.310, 0.003, 0.000], [0.235, 0.044, 0.000]],
[[0.235, 0.044, 0.000], [0.161, 0.084, 0.000], [0.103, 0.144, 0.000], [0.062, 0.224, 0.000]],
[[0.062, 0.224, 0.000], [0.021, 0.304, 0.000], [-0.000, 0.396, 0.000], [-0.000, 0.499, 0.000]],
[[-0.000, 0.499, 0.000], [-0.000, 0.609, 0.000], [0.022, 0.703, 0.000], [0.067, 0.784, 0.000]],
[[0.067, 0.784, 0.000], [0.112, 0.865, 0.000], [0.178, 0.926, 0.000], [0.265, 0.968, 0.000]],
[[0.265, 0.968, 0.000], [0.333, 1.000, 0.000], [0.424, 1.016, 0.000], [0.538, 1.016, 0.000]],
[[0.538, 1.016, 0.000], [0.649, 1.016, 0.000], [0.731, 1.006, 0.000], [0.786, 0.986, 0.000]],
[[0.786, 0.986, 0.000], [0.841, 0.966, 0.000], [0.886, 0.935, 0.000], [0.922, 0.893, 0.000]],
[[0.922, 0.893, 0.000], [0.958, 0.851, 0.000], [0.986, 0.798, 0.000], [1.004, 0.733, 0.000]],
[[1.004, 0.733, 0.000], [0.904, 0.715, 0.000], [0.805, 0.698, 0.000], [0.706, 0.680, 0.000]],
[[0.706, 0.680, 0.000], [0.694, 0.718, 0.000], [0.673, 0.747, 0.000], [0.644, 0.767, 0.000]],
[[0.644, 0.767, 0.000], [0.614, 0.787, 0.000], [0.577, 0.797, 0.000], [0.532, 0.797, 0.000]],
[[0.532, 0.797, 0.000], [0.464, 0.797, 0.000], [0.410, 0.773, 0.000], [0.370, 0.726, 0.000]],
[[0.370, 0.726, 0.000], [0.329, 0.679, 0.000], [0.309, 0.605, 0.000], [0.309, 0.503, 0.000]],
[[0.309, 0.503, 0.000], [0.309, 0.395, 0.000], [0.330, 0.318, 0.000], [0.370, 0.271, 0.000]],
[[0.370, 0.271, 0.000], [0.411, 0.225, 0.000], [0.468, 0.202, 0.000], [0.540, 0.202, 0.000]],
[[0.540, 0.202, 0.000], [0.575, 0.202, 0.000], [0.608, 0.207, 0.000], [0.639, 0.217, 0.000]],
[[0.639, 0.217, 0.000], [0.671, 0.227, 0.000], [0.706, 0.244, 0.000], [0.747, 0.268, 0.000]],
[[0.747, 0.268, 0.000], [0.747, 0.299, 0.000], [0.747, 0.330, 0.000], [0.747, 0.362, 0.000]],
[[0.747, 0.362, 0.000], [0.678, 0.362, 0.000], [0.609, 0.362, 0.000], [0.540, 0.362, 0.000]]]],
'H': [[[[-0.000, 0.999, 0.000], [0.103, 0.999, 0.000], [0.206, 0.999, 0.000], [0.309, 0.999, 0.000]],
[[0.309, 0.999, 0.000], [0.309, 0.882, 0.000], [0.309, 0.766, 0.000], [0.309, 0.649, 0.000]],
[[0.309, 0.649, 0.000], [0.421, 0.649, 0.000], [0.534, 0.649, 0.000], [0.646, 0.649, 0.000]],
[[0.646, 0.649, 0.000], [0.646, 0.766, 0.000], [0.646, 0.882, 0.000], [0.646, 0.999, 0.000]],
[[0.646, 0.999, 0.000], [0.749, 0.999, 0.000], [0.853, 0.999, 0.000], [0.956, 0.999, 0.000]],
[[0.956, 0.999, 0.000], [0.956, 0.666, 0.000], [0.956, 0.333, 0.000], [0.956, 0.000, 0.000]],
[[0.956, 0.000, 0.000], [0.853, 0.000, 0.000], [0.749, 0.000, 0.000], [0.646, 0.000, 0.000]],
[[0.646, 0.000, 0.000], [0.646, 0.135, 0.000], [0.646, 0.269, 0.000], [0.646, 0.404, 0.000]],
[[0.646, 0.404, 0.000], [0.534, 0.404, 0.000], [0.421, 0.404, 0.000], [0.309, 0.404, 0.000]],
[[0.309, 0.404, 0.000], [0.309, 0.269, 0.000], [0.309, 0.135, 0.000], [0.309, 0.000, 0.000]],
[[0.309, 0.000, 0.000], [0.206, 0.000, 0.000], [0.103, 0.000, 0.000], [-0.000, 0.000, 0.000]],
[[-0.000, 0.000, 0.000], [-0.000, 0.333, 0.000], [-0.000, 0.666, 0.000], [-0.000, 0.999, 0.000]]]],
'I': [[[[0.000, 0.999, 0.000], [0.103, 0.999, 0.000], [0.206, 0.999, 0.000], [0.309, 0.999, 0.000]],
[[0.309, 0.999, 0.000], [0.309, 0.666, 0.000], [0.309, 0.333, 0.000], [0.309, 0.000, 0.000]],
[[0.309, 0.000, 0.000], [0.206, 0.000, 0.000], [0.103, 0.000, 0.000], [0.000, 0.000, 0.000]],
[[0.000, 0.000, 0.000], [0.000, 0.333, 0.000], [0.000, 0.666, 0.000], [0.000, 0.999, 0.000]]]],
'J': [[[[0.494, 0.999, 0.000], [0.597, 0.999, 0.000], [0.700, 0.999, 0.000], [0.803, 0.999, 0.000]],
[[0.803, 0.999, 0.000], [0.803, 0.818, 0.000], [0.803, 0.637, 0.000], [0.803, 0.456, 0.000]],
[[0.803, 0.456, 0.000], [0.803, 0.342, 0.000], [0.793, 0.255, 0.000], [0.773, 0.196, 0.000]],
[[0.773, 0.196, 0.000], [0.753, 0.136, 0.000], [0.712, 0.086, 0.000], [0.651, 0.044, 0.000]],
[[0.651, 0.044, 0.000], [0.590, 0.003, 0.000], [0.512, -0.018, 0.000], [0.416, -0.018, 0.000]],
[[0.416, -0.018, 0.000], [0.315, -0.018, 0.000], [0.237, -0.004, 0.000], [0.182, 0.023, 0.000]],
[[0.182, 0.023, 0.000], [0.127, 0.050, 0.000], [0.084, 0.090, 0.000], [0.053, 0.143, 0.000]],
[[0.053, 0.143, 0.000], [0.023, 0.195, 0.000], [0.005, 0.260, 0.000], [0.000, 0.337, 0.000]],
[[0.000, 0.337, 0.000], [0.098, 0.351, 0.000], [0.197, 0.364, 0.000], [0.295, 0.378, 0.000]],
[[0.295, 0.378, 0.000], [0.296, 0.333, 0.000], [0.299, 0.301, 0.000], [0.307, 0.279, 0.000]],
[[0.307, 0.279, 0.000], [0.314, 0.258, 0.000], [0.326, 0.241, 0.000], [0.343, 0.228, 0.000]],
[[0.343, 0.228, 0.000], [0.355, 0.219, 0.000], [0.372, 0.215, 0.000], [0.394, 0.215, 0.000]],
[[0.394, 0.215, 0.000], [0.428, 0.215, 0.000], [0.454, 0.227, 0.000], [0.470, 0.253, 0.000]],
[[0.470, 0.253, 0.000], [0.486, 0.279, 0.000], [0.494, 0.322, 0.000], [0.494, 0.383, 0.000]],
[[0.494, 0.383, 0.000], [0.494, 0.588, 0.000], [0.494, 0.794, 0.000], [0.494, 0.999, 0.000]]]],
'K': [[[[-0.000, 0.999, 0.000], [0.103, 0.999, 0.000], [0.206, 0.999, 0.000], [0.309, 0.999, 0.000]],
[[0.309, 0.999, 0.000], [0.309, 0.873, 0.000], [0.309, 0.747, 0.000], [0.309, 0.621, 0.000]],
[[0.309, 0.621, 0.000], [0.417, 0.747, 0.000], [0.524, 0.873, 0.000], [0.632, 0.999, 0.000]],
[[0.632, 0.999, 0.000], [0.769, 0.999, 0.000], [0.906, 0.999, 0.000], [1.043, 0.999, 0.000]],
[[1.043, 0.999, 0.000], [0.921, 0.873, 0.000], [0.800, 0.748, 0.000], [0.679, 0.622, 0.000]],
[[0.679, 0.622, 0.000], [0.805, 0.415, 0.000], [0.932, 0.207, 0.000], [1.059, 0.000, 0.000]],
[[1.059, 0.000, 0.000], [0.932, 0.000, 0.000], [0.805, 0.000, 0.000], [0.679, 0.000, 0.000]],
[[0.679, 0.000, 0.000], [0.609, 0.137, 0.000], [0.538, 0.274, 0.000], [0.468, 0.411, 0.000]],
[[0.468, 0.411, 0.000], [0.415, 0.355, 0.000], [0.362, 0.300, 0.000], [0.309, 0.244, 0.000]],
[[0.309, 0.244, 0.000], [0.309, 0.163, 0.000], [0.309, 0.081, 0.000], [0.309, 0.000, 0.000]],
[[0.309, 0.000, 0.000], [0.206, 0.000, 0.000], [0.103, 0.000, 0.000], [-0.000, 0.000, 0.000]],
[[-0.000, 0.000, 0.000], [-0.000, 0.333, 0.000], [-0.000, 0.666, 0.000], [-0.000, 0.999, 0.000]]]],
'L': [[[[-0.000, 0.999, 0.000], [0.103, 0.999, 0.000], [0.206, 0.999, 0.000], [0.309, 0.999, 0.000]],
[[0.309, 0.999, 0.000], [0.309, 0.748, 0.000], [0.309, 0.497, 0.000], [0.309, 0.246, 0.000]],
[[0.309, 0.246, 0.000], [0.469, 0.246, 0.000], [0.630, 0.246, 0.000], [0.790, 0.246, 0.000]],
[[0.790, 0.246, 0.000], [0.790, 0.164, 0.000], [0.790, 0.082, 0.000], [0.790, 0.000, 0.000]],
[[0.790, 0.000, 0.000], [0.527, 0.000, 0.000], [0.263, 0.000, 0.000], [-0.000, 0.000, 0.000]],
[[-0.000, 0.000, 0.000], [-0.000, 0.333, 0.000], [-0.000, 0.666, 0.000], [-0.000, 0.999, 0.000]]]],
'M': [[[[0.000, 0.999, 0.000], [0.135, 0.999, 0.000], [0.271, 0.999, 0.000], [0.406, 0.999, 0.000]],
[[0.406, 0.999, 0.000], [0.458, 0.796, 0.000], [0.511, 0.594, 0.000], [0.563, 0.391, 0.000]],
[[0.563, 0.391, 0.000], [0.615, 0.594, 0.000], [0.667, 0.796, 0.000], [0.719, 0.999, 0.000]],
[[0.719, 0.999, 0.000], [0.854, 0.999, 0.000], [0.989, 0.999, 0.000], [1.124, 0.999, 0.000]],
[[1.124, 0.999, 0.000], [1.124, 0.666, 0.000], [1.124, 0.333, 0.000], [1.124, 0.000, 0.000]],
[[1.124, 0.000, 0.000], [1.040, 0.000, 0.000], [0.956, 0.000, 0.000], [0.872, 0.000, 0.000]],
[[0.872, 0.000, 0.000], [0.872, 0.254, 0.000], [0.872, 0.508, 0.000], [0.872, 0.762, 0.000]],
[[0.872, 0.762, 0.000], [0.806, 0.508, 0.000], [0.741, 0.254, 0.000], [0.676, 0.000, 0.000]],
[[0.676, 0.000, 0.000], [0.600, 0.000, 0.000], [0.524, 0.000, 0.000], [0.448, 0.000, 0.000]],
[[0.448, 0.000, 0.000], [0.383, 0.254, 0.000], [0.318, 0.508, 0.000], [0.253, 0.762, 0.000]],
[[0.253, 0.762, 0.000], [0.253, 0.508, 0.000], [0.253, 0.254, 0.000], [0.253, 0.000, 0.000]],
[[0.253, 0.000, 0.000], [0.169, 0.000, 0.000], [0.084, 0.000, 0.000], [0.000, 0.000, 0.000]],
[[0.000, 0.000, 0.000], [0.000, 0.333, 0.000], [0.000, 0.666, 0.000], [0.000, 0.999, 0.000]]]],
'N': [[[[-0.000, 0.999, 0.000], [0.096, 0.999, 0.000], [0.192, 0.999, 0.000], [0.288, 0.999, 0.000]],
[[0.288, 0.999, 0.000], [0.414, 0.815, 0.000], [0.539, 0.631, 0.000], [0.664, 0.446, 0.000]],
[[0.664, 0.446, 0.000], [0.664, 0.631, 0.000], [0.664, 0.815, 0.000], [0.664, 0.999, 0.000]],
[[0.664, 0.999, 0.000], [0.761, 0.999, 0.000], [0.858, 0.999, 0.000], [0.955, 0.999, 0.000]],
[[0.955, 0.999, 0.000], [0.955, 0.666, 0.000], [0.955, 0.333, 0.000], [0.955, 0.000, 0.000]],
[[0.955, 0.000, 0.000], [0.858, 0.000, 0.000], [0.761, 0.000, 0.000], [0.664, 0.000, 0.000]],
[[0.664, 0.000, 0.000], [0.540, 0.183, 0.000], [0.415, 0.366, 0.000], [0.290, 0.549, 0.000]],
[[0.290, 0.549, 0.000], [0.290, 0.366, 0.000], [0.290, 0.183, 0.000], [0.290, 0.000, 0.000]],
[[0.290, 0.000, 0.000], [0.194, 0.000, 0.000], [0.097, 0.000, 0.000], [-0.000, 0.000, 0.000]],
[[-0.000, 0.000, 0.000], [-0.000, 0.333, 0.000], [-0.000, 0.666, 0.000], [-0.000, 0.999, 0.000]]]],
'O': [[[[-0.000, 0.499, 0.000], [-0.000, 0.662, 0.000], [0.045, 0.789, 0.000], [0.136, 0.880, 0.000]],
[[0.136, 0.880, 0.000], [0.227, 0.971, 0.000], [0.354, 1.016, 0.000], [0.516, 1.016, 0.000]],
[[0.516, 1.016, 0.000], [0.682, 1.016, 0.000], [0.810, 0.971, 0.000], [0.900, 0.882, 0.000]],
[[0.900, 0.882, 0.000], [0.990, 0.793, 0.000], [1.035, 0.668, 0.000], [1.035, 0.507, 0.000]],
[[1.035, 0.507, 0.000], [1.035, 0.390, 0.000], [1.015, 0.294, 0.000], [0.976, 0.220, 0.000]],
[[0.976, 0.220, 0.000], [0.937, 0.145, 0.000], [0.880, 0.087, 0.000], [0.806, 0.045, 0.000]],
[[0.806, 0.045, 0.000], [0.732, 0.004, 0.000], [0.639, -0.017, 0.000], [0.528, -0.017, 0.000]],
[[0.528, -0.017, 0.000], [0.415, -0.017, 0.000], [0.322, 0.001, 0.000], [0.248, 0.037, 0.000]],
[[0.248, 0.037, 0.000], [0.175, 0.073, 0.000], [0.115, 0.129, 0.000], [0.069, 0.207, 0.000]],
[[0.069, 0.207, 0.000], [0.023, 0.285, 0.000], [-0.000, 0.382, 0.000], [-0.000, 0.499, 0.000]]],
[[[0.309, 0.497, 0.000], [0.309, 0.397, 0.000], [0.327, 0.324, 0.000], [0.365, 0.280, 0.000]],
[[0.365, 0.280, 0.000], [0.402, 0.236, 0.000], [0.453, 0.214, 0.000], [0.518, 0.214, 0.000]],
[[0.518, 0.214, 0.000], [0.584, 0.214, 0.000], [0.636, 0.236, 0.000], [0.672, 0.279, 0.000]],
[[0.672, 0.279, 0.000], [0.708, 0.322, 0.000], [0.726, 0.399, 0.000], [0.726, 0.511, 0.000]],
[[0.726, 0.511, 0.000], [0.726, 0.605, 0.000], [0.707, 0.674, 0.000], [0.669, 0.717, 0.000]],
[[0.669, 0.717, 0.000], [0.632, 0.761, 0.000], [0.580, 0.782, 0.000], [0.515, 0.782, 0.000]],
[[0.515, 0.782, 0.000], [0.453, 0.782, 0.000], [0.403, 0.760, 0.000], [0.365, 0.716, 0.000]],
[[0.365, 0.716, 0.000], [0.328, 0.672, 0.000], [0.309, 0.599, 0.000], [0.309, 0.497, 0.000]]]],
'P': [[[[-0.000, 0.999, 0.000], [0.171, 0.999, 0.000], [0.342, 0.999, 0.000], [0.513, 0.999, 0.000]],
[[0.513, 0.999, 0.000], [0.625, 0.999, 0.000], [0.709, 0.972, 0.000], [0.764, 0.919, 0.000]],
[[0.764, 0.919, 0.000], [0.820, 0.866, 0.000], [0.848, 0.790, 0.000], [0.848, 0.692, 0.000]],
[[0.848, 0.692, 0.000], [0.848, 0.591, 0.000], [0.817, 0.513, 0.000], [0.757, 0.456, 0.000]],
[[0.757, 0.456, 0.000], [0.696, 0.399, 0.000], [0.604, 0.371, 0.000], [0.479, 0.371, 0.000]],
[[0.479, 0.371, 0.000], [0.423, 0.371, 0.000], [0.366, 0.371, 0.000], [0.310, 0.371, 0.000]],
[[0.310, 0.371, 0.000], [0.310, 0.247, 0.000], [0.310, 0.124, 0.000], [0.310, 0.000, 0.000]],
[[0.310, 0.000, 0.000], [0.207, 0.000, 0.000], [0.103, 0.000, 0.000], [-0.000, 0.000, 0.000]],
[[-0.000, 0.000, 0.000], [-0.000, 0.333, 0.000], [-0.000, 0.666, 0.000], [-0.000, 0.999, 0.000]]],
[[[0.310, 0.573, 0.000], [0.335, 0.573, 0.000], [0.360, 0.573, 0.000], [0.386, 0.573, 0.000]],
[[0.386, 0.573, 0.000], [0.445, 0.573, 0.000], [0.487, 0.583, 0.000], [0.511, 0.604, 0.000]],
[[0.511, 0.604, 0.000], [0.535, 0.625, 0.000], [0.547, 0.651, 0.000], [0.547, 0.683, 0.000]],
[[0.547, 0.683, 0.000], [0.547, 0.715, 0.000], [0.537, 0.741, 0.000], [0.516, 0.763, 0.000]],
[[0.516, 0.763, 0.000], [0.495, 0.785, 0.000], [0.456, 0.796, 0.000], [0.398, 0.796, 0.000]],
[[0.398, 0.796, 0.000], [0.369, 0.796, 0.000], [0.339, 0.796, 0.000], [0.310, 0.796, 0.000]],
[[0.310, 0.796, 0.000], [0.310, 0.722, 0.000], [0.310, 0.647, 0.000], [0.310, 0.573, 0.000]]]],
'Q': [[[[0.926, 0.146, 0.000], [0.965, 0.119, 0.000], [0.990, 0.102, 0.000], [1.002, 0.095, 0.000]],
[[1.002, 0.095, 0.000], [1.019, 0.085, 0.000], [1.043, 0.074, 0.000], [1.073, 0.061, 0.000]],
[[1.073, 0.061, 0.000], [1.045, 0.003, 0.000], [1.016, -0.055, 0.000], [0.987, -0.112, 0.000]],
[[0.987, -0.112, 0.000], [0.944, -0.092, 0.000], [0.902, -0.067, 0.000], [0.859, -0.038, 0.000]],
[[0.859, -0.038, 0.000], [0.817, -0.009, 0.000], [0.787, 0.013, 0.000], [0.771, 0.027, 0.000]],
[[0.771, 0.027, 0.000], [0.703, -0.002, 0.000], [0.617, -0.017, 0.000], [0.514, -0.017, 0.000]],
[[0.514, -0.017, 0.000], [0.363, -0.017, 0.000], [0.243, 0.022, 0.000], [0.155, 0.102, 0.000]],
[[0.155, 0.102, 0.000], [0.052, 0.195, 0.000], [0.000, 0.327, 0.000], [0.000, 0.496, 0.000]],
[[0.000, 0.496, 0.000], [0.000, 0.661, 0.000], [0.045, 0.788, 0.000], [0.136, 0.879, 0.000]],
[[0.136, 0.879, 0.000], [0.227, 0.970, 0.000], [0.353, 1.016, 0.000], [0.516, 1.016, 0.000]],
[[0.516, 1.016, 0.000], [0.682, 1.016, 0.000], [0.810, 0.971, 0.000], [0.900, 0.882, 0.000]],
[[0.900, 0.882, 0.000], [0.990, 0.793, 0.000], [1.035, 0.666, 0.000], [1.035, 0.500, 0.000]],
[[1.035, 0.500, 0.000], [1.035, 0.353, 0.000], [0.999, 0.234, 0.000], [0.926, 0.146, 0.000]]],
[[[0.690, 0.304, 0.000], [0.714, 0.348, 0.000], [0.726, 0.414, 0.000], [0.726, 0.502, 0.000]],
[[0.726, 0.502, 0.000], [0.726, 0.602, 0.000], [0.708, 0.674, 0.000], [0.670, 0.718, 0.000]],
[[0.670, 0.718, 0.000], [0.633, 0.761, 0.000], [0.581, 0.782, 0.000], [0.515, 0.782, 0.000]],
[[0.515, 0.782, 0.000], [0.454, 0.782, 0.000], [0.404, 0.760, 0.000], [0.366, 0.716, 0.000]],
[[0.366, 0.716, 0.000], [0.328, 0.672, 0.000], [0.309, 0.603, 0.000], [0.309, 0.510, 0.000]],
[[0.309, 0.510, 0.000], [0.309, 0.401, 0.000], [0.327, 0.324, 0.000], [0.365, 0.280, 0.000]],
[[0.365, 0.280, 0.000], [0.402, 0.236, 0.000], [0.453, 0.214, 0.000], [0.518, 0.214, 0.000]],
[[0.518, 0.214, 0.000], [0.539, 0.214, 0.000], [0.559, 0.216, 0.000], [0.577, 0.220, 0.000]],
[[0.577, 0.220, 0.000], [0.551, 0.245, 0.000], [0.510, 0.269, 0.000], [0.455, 0.291, 0.000]],
[[0.455, 0.291, 0.000], [0.471, 0.328, 0.000], [0.487, 0.365, 0.000], [0.503, 0.402, 0.000]],
[[0.503, 0.402, 0.000], [0.530, 0.397, 0.000], [0.551, 0.391, 0.000], [0.567, 0.384, 0.000]],
[[0.567, 0.384, 0.000], [0.582, 0.376, 0.000], [0.611, 0.357, 0.000], [0.656, 0.326, 0.000]],
[[0.656, 0.326, 0.000], [0.666, 0.319, 0.000], [0.677, 0.312, 0.000], [0.690, 0.304, 0.000]]]],
'R': [[[[-0.000, 0.000, 0.000], [-0.000, 0.333, 0.000], [-0.000, 0.666, 0.000], [-0.000, 0.999, 0.000]],
[[-0.000, 0.999, 0.000], [0.171, 0.999, 0.000], [0.343, 0.999, 0.000], [0.514, 0.999, 0.000]],
[[0.514, 0.999, 0.000], [0.610, 0.999, 0.000], [0.683, 0.991, 0.000], [0.733, 0.974, 0.000]],
[[0.733, 0.974, 0.000], [0.784, 0.958, 0.000], [0.824, 0.928, 0.000], [0.855, 0.883, 0.000]],
[[0.855, 0.883, 0.000], [0.886, 0.839, 0.000], [0.902, 0.785, 0.000], [0.902, 0.722, 0.000]],
[[0.902, 0.722, 0.000], [0.902, 0.666, 0.000], [0.890, 0.618, 0.000], [0.866, 0.578, 0.000]],
[[0.866, 0.578, 0.000], [0.842, 0.538, 0.000], [0.810, 0.505, 0.000], [0.769, 0.480, 0.000]],
[[0.769, 0.480, 0.000], [0.742, 0.465, 0.000], [0.706, 0.451, 0.000], [0.660, 0.441, 0.000]],
[[0.660, 0.441, 0.000], [0.697, 0.429, 0.000], [0.724, 0.416, 0.000], [0.741, 0.404, 0.000]],
[[0.741, 0.404, 0.000], [0.752, 0.396, 0.000], [0.769, 0.378, 0.000], [0.790, 0.352, 0.000]],
[[0.790, 0.352, 0.000], [0.812, 0.325, 0.000], [0.826, 0.304, 0.000], [0.833, 0.290, 0.000]],
[[0.833, 0.290, 0.000], [0.883, 0.193, 0.000], [0.933, 0.097, 0.000], [0.983, 0.000, 0.000]],
[[0.983, 0.000, 0.000], [0.866, 0.000, 0.000], [0.750, 0.000, 0.000], [0.634, 0.000, 0.000]],
[[0.634, 0.000, 0.000], [0.579, 0.102, 0.000], [0.524, 0.204, 0.000], [0.469, 0.305, 0.000]],
[[0.469, 0.305, 0.000], [0.448, 0.345, 0.000], [0.429, 0.370, 0.000], [0.413, 0.382, 0.000]],
[[0.413, 0.382, 0.000], [0.391, 0.398, 0.000], [0.365, 0.405, 0.000], [0.337, 0.405, 0.000]],
[[0.337, 0.405, 0.000], [0.328, 0.405, 0.000], [0.319, 0.405, 0.000], [0.310, 0.405, 0.000]],
[[0.310, 0.405, 0.000], [0.310, 0.270, 0.000], [0.310, 0.135, 0.000], [0.310, 0.000, 0.000]],
[[0.310, 0.000, 0.000], [0.207, 0.000, 0.000], [0.103, 0.000, 0.000], [-0.000, 0.000, 0.000]]],
[[[0.310, 0.594, 0.000], [0.353, 0.594, 0.000], [0.397, 0.594, 0.000], [0.440, 0.594, 0.000]],
[[0.440, 0.594, 0.000], [0.454, 0.594, 0.000], [0.482, 0.599, 0.000], [0.522, 0.608, 0.000]],
[[0.522, 0.608, 0.000], [0.542, 0.612, 0.000], [0.559, 0.622, 0.000], [0.572, 0.639, 0.000]],
[[0.572, 0.639, 0.000], [0.585, 0.656, 0.000], [0.591, 0.675, 0.000], [0.591, 0.697, 0.000]],
[[0.591, 0.697, 0.000], [0.591, 0.729, 0.000], [0.581, 0.754, 0.000], [0.561, 0.771, 0.000]],
[[0.561, 0.771, 0.000], [0.540, 0.789, 0.000], [0.502, 0.797, 0.000], [0.446, 0.797, 0.000]],
[[0.446, 0.797, 0.000], [0.400, 0.797, 0.000], [0.355, 0.797, 0.000], [0.310, 0.797, 0.000]],
[[0.310, 0.797, 0.000], [0.310, 0.730, 0.000], [0.310, 0.662, 0.000], [0.310, 0.594, 0.000]]]],
'S': [[[[0.000, 0.330, 0.000], [0.098, 0.337, 0.000], [0.196, 0.343, 0.000], [0.294, 0.349, 0.000]],
[[0.294, 0.349, 0.000], [0.300, 0.301, 0.000], [0.313, 0.265, 0.000], [0.333, 0.240, 0.000]],
[[0.333, 0.240, 0.000], [0.364, 0.199, 0.000], [0.410, 0.179, 0.000], [0.469, 0.179, 0.000]],
[[0.469, 0.179, 0.000], [0.513, 0.179, 0.000], [0.547, 0.190, 0.000], [0.571, 0.210, 0.000]],
[[0.571, 0.210, 0.000], [0.595, 0.231, 0.000], [0.606, 0.255, 0.000], [0.606, 0.282, 0.000]],
[[0.606, 0.282, 0.000], [0.606, 0.308, 0.000], [0.595, 0.331, 0.000], [0.572, 0.352, 0.000]],
[[0.572, 0.352, 0.000], [0.550, 0.372, 0.000], [0.497, 0.391, 0.000], [0.414, 0.410, 0.000]],
[[0.414, 0.410, 0.000], [0.279, 0.440, 0.000], [0.182, 0.480, 0.000], [0.125, 0.531, 0.000]],
[[0.125, 0.531, 0.000], [0.067, 0.581, 0.000], [0.037, 0.646, 0.000], [0.037, 0.724, 0.000]],
[[0.037, 0.724, 0.000], [0.037, 0.775, 0.000], [0.052, 0.823, 0.000], [0.082, 0.869, 0.000]],
[[0.082, 0.869, 0.000], [0.112, 0.915, 0.000], [0.157, 0.951, 0.000], [0.216, 0.977, 0.000]],
[[0.216, 0.977, 0.000], [0.276, 1.003, 0.000], [0.358, 1.016, 0.000], [0.462, 1.016, 0.000]],
[[0.462, 1.016, 0.000], [0.590, 1.016, 0.000], [0.687, 0.992, 0.000], [0.754, 0.945, 0.000]],
[[0.754, 0.945, 0.000], [0.821, 0.897, 0.000], [0.861, 0.822, 0.000], [0.874, 0.718, 0.000]],
[[0.874, 0.718, 0.000], [0.777, 0.713, 0.000], [0.680, 0.707, 0.000], [0.583, 0.701, 0.000]],
[[0.583, 0.701, 0.000], [0.575, 0.746, 0.000], [0.559, 0.779, 0.000], [0.534, 0.799, 0.000]],
[[0.534, 0.799, 0.000], [0.509, 0.820, 0.000], [0.475, 0.830, 0.000], [0.431, 0.830, 0.000]],
[[0.431, 0.830, 0.000], [0.395, 0.830, 0.000], [0.368, 0.822, 0.000], [0.350, 0.807, 0.000]],
[[0.350, 0.807, 0.000], [0.332, 0.792, 0.000], [0.323, 0.773, 0.000], [0.323, 0.752, 0.000]],
[[0.323, 0.752, 0.000], [0.323, 0.736, 0.000], [0.330, 0.721, 0.000], [0.345, 0.709, 0.000]],
[[0.345, 0.709, 0.000], [0.360, 0.696, 0.000], [0.395, 0.683, 0.000], [0.449, 0.672, 0.000]],
[[0.449, 0.672, 0.000], [0.584, 0.643, 0.000], [0.681, 0.613, 0.000], [0.739, 0.584, 0.000]],
[[0.739, 0.584, 0.000], [0.797, 0.554, 0.000], [0.840, 0.517, 0.000], [0.866, 0.473, 0.000]],
[[0.866, 0.473, 0.000], [0.893, 0.429, 0.000], [0.906, 0.380, 0.000], [0.906, 0.325, 0.000]],
[[0.906, 0.325, 0.000], [0.906, 0.261, 0.000], [0.889, 0.202, 0.000], [0.853, 0.148, 0.000]],
[[0.853, 0.148, 0.000], [0.818, 0.094, 0.000], [0.768, 0.053, 0.000], [0.705, 0.025, 0.000]],
[[0.705, 0.025, 0.000], [0.641, -0.003, 0.000], [0.561, -0.017, 0.000], [0.464, -0.017, 0.000]],
[[0.464, -0.017, 0.000], [0.294, -0.017, 0.000], [0.176, 0.016, 0.000], [0.111, 0.081, 0.000]],
[[0.111, 0.081, 0.000], [0.046, 0.147, 0.000], [0.009, 0.230, 0.000], [0.000, 0.330, 0.000]]]],
'T': [[[[0.000, 0.999, 0.000], [0.313, 0.999, 0.000], [0.626, 0.999, 0.000], [0.938, 0.999, 0.000]],
[[0.938, 0.999, 0.000], [0.938, 0.917, 0.000], [0.938, 0.835, 0.000], [0.938, 0.752, 0.000]],
[[0.938, 0.752, 0.000], [0.833, 0.752, 0.000], [0.728, 0.752, 0.000], [0.623, 0.752, 0.000]],
[[0.623, 0.752, 0.000], [0.623, 0.502, 0.000], [0.623, 0.251, 0.000], [0.623, 0.000, 0.000]],
[[0.623, 0.000, 0.000], [0.521, 0.000, 0.000], [0.418, 0.000, 0.000], [0.315, 0.000, 0.000]],
[[0.315, 0.000, 0.000], [0.315, 0.251, 0.000], [0.315, 0.502, 0.000], [0.315, 0.752, 0.000]],
[[0.315, 0.752, 0.000], [0.210, 0.752, 0.000], [0.105, 0.752, 0.000], [0.000, 0.752, 0.000]],
[[0.000, 0.752, 0.000], [0.000, 0.835, 0.000], [0.000, 0.917, 0.000], [0.000, 0.999, 0.000]]]],
'U': [[[[0.649, 0.999, 0.000], [0.752, 0.999, 0.000], [0.855, 0.999, 0.000], [0.957, 0.999, 0.000]],
[[0.957, 0.999, 0.000], [0.957, 0.800, 0.000], [0.957, 0.602, 0.000], [0.957, 0.403, 0.000]],
[[0.957, 0.403, 0.000], [0.957, 0.344, 0.000], [0.948, 0.289, 0.000], [0.930, 0.236, 0.000]],
[[0.930, 0.236, 0.000], [0.911, 0.184, 0.000], [0.883, 0.138, 0.000], [0.843, 0.098, 0.000]],
[[0.843, 0.098, 0.000], [0.804, 0.059, 0.000], [0.763, 0.032, 0.000], [0.720, 0.016, 0.000]],
[[0.720, 0.016, 0.000], [0.660, -0.007, 0.000], [0.588, -0.018, 0.000], [0.504, -0.018, 0.000]],
[[0.504, -0.018, 0.000], [0.455, -0.018, 0.000], [0.402, -0.014, 0.000], [0.344, -0.007, 0.000]],
[[0.344, -0.007, 0.000], [0.287, -0.001, 0.000], [0.239, 0.013, 0.000], [0.200, 0.033, 0.000]],
[[0.200, 0.033, 0.000], [0.162, 0.053, 0.000], [0.126, 0.082, 0.000], [0.094, 0.119, 0.000]],
[[0.094, 0.119, 0.000], [0.062, 0.156, 0.000], [0.040, 0.195, 0.000], [0.029, 0.234, 0.000]],
[[0.029, 0.234, 0.000], [0.010, 0.298, 0.000], [0.000, 0.354, 0.000], [0.000, 0.403, 0.000]],
[[0.000, 0.403, 0.000], [0.000, 0.602, 0.000], [0.000, 0.800, 0.000], [0.000, 0.999, 0.000]],
[[0.000, 0.999, 0.000], [0.103, 0.999, 0.000], [0.205, 0.999, 0.000], [0.308, 0.999, 0.000]],
[[0.308, 0.999, 0.000], [0.308, 0.796, 0.000], [0.308, 0.592, 0.000], [0.308, 0.389, 0.000]],
[[0.308, 0.389, 0.000], [0.308, 0.335, 0.000], [0.323, 0.292, 0.000], [0.353, 0.261, 0.000]],
[[0.353, 0.261, 0.000], [0.384, 0.231, 0.000], [0.425, 0.215, 0.000], [0.479, 0.215, 0.000]],
[[0.479, 0.215, 0.000], [0.532, 0.215, 0.000], [0.574, 0.230, 0.000], [0.604, 0.261, 0.000]],
[[0.604, 0.261, 0.000], [0.634, 0.291, 0.000], [0.649, 0.334, 0.000], [0.649, 0.389, 0.000]],
[[0.649, 0.389, 0.000], [0.649, 0.592, 0.000], [0.649, 0.796, 0.000], [0.649, 0.999, 0.000]]]],
'V': [[[[0.000, 0.999, 0.000], [0.108, 0.999, 0.000], [0.215, 0.999, 0.000], [0.323, 0.999, 0.000]],
[[0.323, 0.999, 0.000], [0.398, 0.759, 0.000], [0.473, 0.520, 0.000], [0.548, 0.280, 0.000]],
[[0.548, 0.280, 0.000], [0.622, 0.520, 0.000], [0.696, 0.759, 0.000], [0.769, 0.999, 0.000]],
[[0.769, 0.999, 0.000], [0.874, 0.999, 0.000], [0.978, 0.999, 0.000], [1.083, 0.999, 0.000]],
[[1.083, 0.999, 0.000], [0.959, 0.666, 0.000], [0.836, 0.333, 0.000], [0.712, 0.000, 0.000]],
[[0.712, 0.000, 0.000], [0.601, 0.000, 0.000], [0.489, 0.000, 0.000], [0.378, 0.000, 0.000]],
[[0.378, 0.000, 0.000], [0.252, 0.333, 0.000], [0.126, 0.666, 0.000], [0.000, 0.999, 0.000]]]],
'W': [[[[-0.000, 0.999, 0.000], [0.098, 0.999, 0.000], [0.195, 0.999, 0.000], [0.293, 0.999, 0.000]],
[[0.293, 0.999, 0.000], [0.328, 0.813, 0.000], [0.363, 0.627, 0.000], [0.399, 0.441, 0.000]],
[[0.399, 0.441, 0.000], [0.450, 0.627, 0.000], [0.501, 0.813, 0.000], [0.553, 0.999, 0.000]],
[[0.553, 0.999, 0.000], [0.650, 0.999, 0.000], [0.748, 0.999, 0.000], [0.845, 0.999, 0.000]],
[[0.845, 0.999, 0.000], [0.897, 0.813, 0.000], [0.948, 0.627, 0.000], [1.000, 0.441, 0.000]],
[[1.000, 0.441, 0.000], [1.035, 0.627, 0.000], [1.070, 0.813, 0.000], [1.105, 0.999, 0.000]],
[[1.105, 0.999, 0.000], [1.202, 0.999, 0.000], [1.300, 0.999, 0.000], [1.397, 0.999, 0.000]],
[[1.397, 0.999, 0.000], [1.324, 0.666, 0.000], [1.250, 0.333, 0.000], [1.177, 0.000, 0.000]],
[[1.177, 0.000, 0.000], [1.076, 0.000, 0.000], [0.975, 0.000, 0.000], [0.874, 0.000, 0.000]],
[[0.874, 0.000, 0.000], [0.816, 0.210, 0.000], [0.758, 0.419, 0.000], [0.699, 0.629, 0.000]],
[[0.699, 0.629, 0.000], [0.641, 0.419, 0.000], [0.583, 0.210, 0.000], [0.525, 0.000, 0.000]],
[[0.525, 0.000, 0.000], [0.424, 0.000, 0.000], [0.323, 0.000, 0.000], [0.222, 0.000, 0.000]],
[[0.222, 0.000, 0.000], [0.148, 0.333, 0.000], [0.074, 0.666, 0.000], [-0.000, 0.999, 0.000]]]],
'X': [[[[0.031, 0.999, 0.000], [0.145, 0.999, 0.000], [0.258, 0.999, 0.000], [0.371, 0.999, 0.000]],
[[0.371, 0.999, 0.000], [0.430, 0.897, 0.000], [0.489, 0.794, 0.000], [0.549, 0.692, 0.000]],
[[0.549, 0.692, 0.000], [0.606, 0.794, 0.000], [0.663, 0.897, 0.000], [0.720, 0.999, 0.000]],
[[0.720, 0.999, 0.000], [0.832, 0.999, 0.000], [0.945, 0.999, 0.000], [1.057, 0.999, 0.000]],
[[1.057, 0.999, 0.000], [0.953, 0.838, 0.000], [0.850, 0.676, 0.000], [0.746, 0.515, 0.000]],
[[0.746, 0.515, 0.000], [0.859, 0.343, 0.000], [0.973, 0.172, 0.000], [1.086, 0.000, 0.000]],
[[1.086, 0.000, 0.000], [0.971, 0.000, 0.000], [0.855, 0.000, 0.000], [0.739, 0.000, 0.000]],
[[0.739, 0.000, 0.000], [0.674, 0.107, 0.000], [0.608, 0.214, 0.000], [0.542, 0.321, 0.000]],
[[0.542, 0.321, 0.000], [0.477, 0.214, 0.000], [0.411, 0.107, 0.000], [0.345, 0.000, 0.000]],
[[0.345, 0.000, 0.000], [0.230, 0.000, 0.000], [0.115, 0.000, 0.000], [-0.000, 0.000, 0.000]],
[[-0.000, 0.000, 0.000], [0.115, 0.174, 0.000], [0.230, 0.347, 0.000], [0.345, 0.521, 0.000]],
[[0.345, 0.521, 0.000], [0.240, 0.680, 0.000], [0.136, 0.840, 0.000], [0.031, 0.999, 0.000]]]],
'Y': [[[[-0.000, 0.999, 0.000], [0.114, 0.999, 0.000], [0.229, 0.999, 0.000], [0.343, 0.999, 0.000]],
[[0.343, 0.999, 0.000], [0.410, 0.887, 0.000], [0.477, 0.774, 0.000], [0.544, 0.662, 0.000]],
[[0.544, 0.662, 0.000], [0.612, 0.774, 0.000], [0.679, 0.887, 0.000], [0.746, 0.999, 0.000]],
[[0.746, 0.999, 0.000], [0.860, 0.999, 0.000], [0.973, 0.999, 0.000], [1.087, 0.999, 0.000]],
[[1.087, 0.999, 0.000], [0.957, 0.805, 0.000], [0.828, 0.612, 0.000], [0.698, 0.418, 0.000]],
[[0.698, 0.418, 0.000], [0.698, 0.279, 0.000], [0.698, 0.139, 0.000], [0.698, 0.000, 0.000]],
[[0.698, 0.000, 0.000], [0.595, 0.000, 0.000], [0.492, 0.000, 0.000], [0.389, 0.000, 0.000]],
[[0.389, 0.000, 0.000], [0.389, 0.139, 0.000], [0.389, 0.279, 0.000], [0.389, 0.418, 0.000]],
[[0.389, 0.418, 0.000], [0.259, 0.612, 0.000], [0.130, 0.805, 0.000], [-0.000, 0.999, 0.000]]]],
'Z': [[[[0.054, 0.999, 0.000], [0.345, 0.999, 0.000], [0.636, 0.999, 0.000], [0.927, 0.999, 0.000]],
[[0.927, 0.999, 0.000], [0.927, 0.932, 0.000], [0.927, 0.866, 0.000], [0.927, 0.799, 0.000]],
[[0.927, 0.799, 0.000], [0.741, 0.604, 0.000], [0.554, 0.410, 0.000], [0.367, 0.215, 0.000]],
[[0.367, 0.215, 0.000], [0.561, 0.215, 0.000], [0.754, 0.215, 0.000], [0.948, 0.215, 0.000]],
[[0.948, 0.215, 0.000], [0.948, 0.143, 0.000], [0.948, 0.072, 0.000], [0.948, 0.000, 0.000]],
[[0.948, 0.000, 0.000], [0.632, 0.000, 0.000], [0.316, 0.000, 0.000], [-0.000, 0.000, 0.000]],
[[-0.000, 0.000, 0.000], [-0.000, 0.069, 0.000], [-0.000, 0.138, 0.000], [-0.000, 0.207, 0.000]],
[[-0.000, 0.207, 0.000], [0.185, 0.400, 0.000], [0.369, 0.593, 0.000], [0.554, 0.786, 0.000]],
[[0.554, 0.786, 0.000], [0.387, 0.786, 0.000], [0.221, 0.786, 0.000], [0.054, 0.786, 0.000]],
[[0.054, 0.786, 0.000], [0.054, 0.857, 0.000], [0.054, 0.928, 0.000], [0.054, 0.999, 0.000]]]],
'CTRL': [[[[0.326, 0.279, 0.000], [0.355, 0.270, 0.000], [0.384, 0.261, 0.000], [0.414, 0.252, 0.000]],
[[0.414, 0.252, 0.000], [0.408, 0.228, 0.000], [0.398, 0.207, 0.000], [0.386, 0.191, 0.000]],
[[0.386, 0.191, 0.000], [0.373, 0.174, 0.000], [0.357, 0.162, 0.000], [0.339, 0.154, 0.000]],
[[0.339, 0.154, 0.000], [0.320, 0.145, 0.000], [0.296, 0.141, 0.000], [0.267, 0.141, 0.000]],
[[0.267, 0.141, 0.000], [0.232, 0.141, 0.000], [0.203, 0.146, 0.000], [0.181, 0.156, 0.000]],
[[0.181, 0.156, 0.000], [0.159, 0.167, 0.000], [0.140, 0.185, 0.000], [0.124, 0.210, 0.000]],
[[0.124, 0.210, 0.000], [0.107, 0.236, 0.000], [0.099, 0.269, 0.000], [0.099, 0.309, 0.000]],
[[0.099, 0.309, 0.000], [0.099, 0.362, 0.000], [0.114, 0.404, 0.000], [0.142, 0.432, 0.000]],
[[0.142, 0.432, 0.000], [0.170, 0.461, 0.000], [0.211, 0.475, 0.000], [0.263, 0.475, 0.000]],
[[0.263, 0.475, 0.000], [0.303, 0.475, 0.000], [0.335, 0.467, 0.000], [0.359, 0.451, 0.000]],
[[0.359, 0.451, 0.000], [0.382, 0.434, 0.000], [0.399, 0.409, 0.000], [0.410, 0.375, 0.000]],
[[0.410, 0.375, 0.000], [0.381, 0.368, 0.000], [0.352, 0.362, 0.000], [0.322, 0.355, 0.000]],
[[0.322, 0.355, 0.000], [0.319, 0.365, 0.000], [0.316, 0.372, 0.000], [0.313, 0.377, 0.000]],
[[0.313, 0.377, 0.000], [0.307, 0.384, 0.000], [0.300, 0.390, 0.000], [0.292, 0.394, 0.000]],
[[0.292, 0.394, 0.000], [0.284, 0.399, 0.000], [0.275, 0.401, 0.000], [0.265, 0.401, 0.000]],
[[0.265, 0.401, 0.000], [0.242, 0.401, 0.000], [0.225, 0.391, 0.000], [0.213, 0.373, 0.000]],
[[0.213, 0.373, 0.000], [0.204, 0.360, 0.000], [0.199, 0.339, 0.000], [0.199, 0.310, 0.000]],
[[0.199, 0.310, 0.000], [0.199, 0.274, 0.000], [0.205, 0.249, 0.000], [0.216, 0.236, 0.000]],
[[0.216, 0.236, 0.000], [0.227, 0.223, 0.000], [0.242, 0.216, 0.000], [0.262, 0.216, 0.000]],
[[0.262, 0.216, 0.000], [0.281, 0.216, 0.000], [0.295, 0.221, 0.000], [0.305, 0.232, 0.000]],
[[0.305, 0.232, 0.000], [0.315, 0.243, 0.000], [0.322, 0.258, 0.000], [0.326, 0.279, 0.000]]],
[[[0.564, 0.470, 0.000], [0.564, 0.440, 0.000], [0.564, 0.410, 0.000], [0.564, 0.381, 0.000]],
[[0.564, 0.381, 0.000], [0.581, 0.381, 0.000], [0.597, 0.381, 0.000], [0.614, 0.381, 0.000]],
[[0.614, 0.381, 0.000], [0.614, 0.359, 0.000], [0.614, 0.337, 0.000], [0.614, 0.315, 0.000]],
[[0.614, 0.315, 0.000], [0.597, 0.315, 0.000], [0.581, 0.315, 0.000], [0.564, 0.315, 0.000]],
[[0.564, 0.315, 0.000], [0.564, 0.288, 0.000], [0.564, 0.260, 0.000], [0.564, 0.232, 0.000]],
[[0.564, 0.232, 0.000], [0.564, 0.222, 0.000], [0.565, 0.216, 0.000], [0.567, 0.212, 0.000]],
[[0.567, 0.212, 0.000], [0.570, 0.207, 0.000], [0.575, 0.205, 0.000], [0.583, 0.205, 0.000]],
[[0.583, 0.205, 0.000], [0.589, 0.205, 0.000], [0.598, 0.207, 0.000], [0.610, 0.211, 0.000]],
[[0.610, 0.211, 0.000], [0.613, 0.190, 0.000], [0.615, 0.169, 0.000], [0.617, 0.149, 0.000]],
[[0.617, 0.149, 0.000], [0.595, 0.144, 0.000], [0.574, 0.142, 0.000], [0.555, 0.142, 0.000]],
[[0.555, 0.142, 0.000], [0.532, 0.142, 0.000], [0.516, 0.144, 0.000], [0.505, 0.150, 0.000]],
[[0.505, 0.150, 0.000], [0.495, 0.156, 0.000], [0.487, 0.165, 0.000], [0.482, 0.176, 0.000]],
[[0.482, 0.176, 0.000], [0.477, 0.188, 0.000], [0.474, 0.207, 0.000], [0.474, 0.233, 0.000]],
[[0.474, 0.233, 0.000], [0.474, 0.260, 0.000], [0.474, 0.288, 0.000], [0.474, 0.315, 0.000]],
[[0.474, 0.315, 0.000], [0.463, 0.315, 0.000], [0.452, 0.315, 0.000], [0.441, 0.315, 0.000]],
[[0.441, 0.315, 0.000], [0.441, 0.337, 0.000], [0.441, 0.359, 0.000], [0.441, 0.381, 0.000]],
[[0.441, 0.381, 0.000], [0.452, 0.381, 0.000], [0.463, 0.381, 0.000], [0.474, 0.381, 0.000]],
[[0.474, 0.381, 0.000], [0.474, 0.395, 0.000], [0.474, 0.409, 0.000], [0.474, 0.424, 0.000]],
[[0.474, 0.424, 0.000], [0.504, 0.439, 0.000], [0.534, 0.454, 0.000], [0.564, 0.470, 0.000]]],
[[[0.657, 0.381, 0.000], [0.685, 0.381, 0.000], [0.713, 0.381, 0.000], [0.741, 0.381, 0.000]],
[[0.741, 0.381, 0.000], [0.741, 0.368, 0.000], [0.741, 0.355, 0.000], [0.741, 0.342, 0.000]],
[[0.741, 0.342, 0.000], [0.749, 0.359, 0.000], [0.758, 0.371, 0.000], [0.766, 0.377, 0.000]],
[[0.766, 0.377, 0.000], [0.775, 0.383, 0.000], [0.785, 0.386, 0.000], [0.798, 0.386, 0.000]],
[[0.798, 0.386, 0.000], [0.811, 0.386, 0.000], [0.826, 0.382, 0.000], [0.841, 0.374, 0.000]],
[[0.841, 0.374, 0.000], [0.832, 0.352, 0.000], [0.823, 0.331, 0.000], [0.814, 0.310, 0.000]],
[[0.814, 0.310, 0.000], [0.803, 0.314, 0.000], [0.795, 0.316, 0.000], [0.789, 0.316, 0.000]],
[[0.789, 0.316, 0.000], [0.777, 0.316, 0.000], [0.768, 0.312, 0.000], [0.761, 0.302, 0.000]],
[[0.761, 0.302, 0.000], [0.752, 0.288, 0.000], [0.747, 0.263, 0.000], [0.747, 0.225, 0.000]],
[[0.747, 0.225, 0.000], [0.747, 0.199, 0.000], [0.747, 0.173, 0.000], [0.747, 0.147, 0.000]],
[[0.747, 0.147, 0.000], [0.717, 0.147, 0.000], [0.687, 0.147, 0.000], [0.657, 0.147, 0.000]],
[[0.657, 0.147, 0.000], [0.657, 0.225, 0.000], [0.657, 0.303, 0.000], [0.657, 0.381, 0.000]]],
[[[0.860, 0.470, 0.000], [0.890, 0.470, 0.000], [0.920, 0.470, 0.000], [0.950, 0.470, 0.000]],
[[0.950, 0.470, 0.000], [0.950, 0.362, 0.000], [0.950, 0.254, 0.000], [0.950, 0.147, 0.000]],
[[0.950, 0.147, 0.000], [0.920, 0.147, 0.000], [0.890, 0.147, 0.000], [0.860, 0.147, 0.000]],
[[0.860, 0.147, 0.000], [0.860, 0.254, 0.000], [0.860, 0.362, 0.000], [0.860, 0.470, 0.000]]],
[[[0.273, 0.002, 0.000], [0.126, 0.002, 0.000], [0.002, 0.017, 0.000], [0.002, 0.273, 0.000]],
[[0.002, 0.273, 0.000], [0.002, 0.424, 0.000], [0.002, 0.576, 0.000], [0.002, 0.727, 0.000]],
[[0.002, 0.727, 0.000], [0.002, 0.919, 0.000], [0.126, 0.999, 0.000], [0.273, 0.999, 0.000]],
[[0.273, 0.999, 0.000], [0.483, 0.999, 0.000], [0.692, 0.999, 0.000], [0.902, 0.999, 0.000]],
[[0.902, 0.999, 0.000], [1.095, 0.999, 0.000], [1.173, 0.919, 0.000], [1.173, 0.727, 0.000]],
[[1.173, 0.727, 0.000], [1.173, 0.576, 0.000], [1.173, 0.424, 0.000], [1.173, 0.273, 0.000]],
[[1.173, 0.273, 0.000], [1.173, 0.017, 0.000], [1.095, 0.002, 0.000], [0.902, 0.002, 0.000]],
[[0.902, 0.002, 0.000], [0.692, 0.002, 0.000], [0.483, 0.002, 0.000], [0.273, 0.002, 0.000]]]],
'ALT': [[[[0.377, 0.210, 0.000], [0.339, 0.210, 0.000], [0.301, 0.210, 0.000], [0.263, 0.210, 0.000]],
[[0.263, 0.210, 0.000], [0.258, 0.192, 0.000], [0.253, 0.174, 0.000], [0.247, 0.156, 0.000]],
[[0.247, 0.156, 0.000], [0.213, 0.156, 0.000], [0.179, 0.156, 0.000], [0.145, 0.156, 0.000]],
[[0.145, 0.156, 0.000], [0.186, 0.264, 0.000], [0.226, 0.372, 0.000], [0.267, 0.479, 0.000]],
[[0.267, 0.479, 0.000], [0.303, 0.479, 0.000], [0.339, 0.479, 0.000], [0.376, 0.479, 0.000]],
[[0.376, 0.479, 0.000], [0.416, 0.372, 0.000], [0.457, 0.264, 0.000], [0.497, 0.156, 0.000]],
[[0.497, 0.156, 0.000], [0.462, 0.156, 0.000], [0.427, 0.156, 0.000], [0.393, 0.156, 0.000]],
[[0.393, 0.156, 0.000], [0.387, 0.174, 0.000], [0.382, 0.192, 0.000], [0.377, 0.210, 0.000]]],
[[[0.356, 0.280, 0.000], [0.344, 0.318, 0.000], [0.332, 0.357, 0.000], [0.320, 0.396, 0.000]],
[[0.320, 0.396, 0.000], [0.308, 0.357, 0.000], [0.297, 0.318, 0.000], [0.285, 0.280, 0.000]],
[[0.285, 0.280, 0.000], [0.308, 0.280, 0.000], [0.332, 0.280, 0.000], [0.356, 0.280, 0.000]]],
[[[0.526, 0.479, 0.000], [0.556, 0.479, 0.000], [0.586, 0.479, 0.000], [0.616, 0.479, 0.000]],
[[0.616, 0.479, 0.000], [0.616, 0.372, 0.000], [0.616, 0.264, 0.000], [0.616, 0.156, 0.000]],
[[0.616, 0.156, 0.000], [0.586, 0.156, 0.000], [0.556, 0.156, 0.000], [0.526, 0.156, 0.000]],
[[0.526, 0.156, 0.000], [0.526, 0.264, 0.000], [0.526, 0.372, 0.000], [0.526, 0.479, 0.000]]],
[[[0.782, 0.479, 0.000], [0.782, 0.450, 0.000], [0.782, 0.420, 0.000], [0.782, 0.390, 0.000]],
[[0.782, 0.390, 0.000], [0.798, 0.390, 0.000], [0.814, 0.390, 0.000], [0.831, 0.390, 0.000]],
[[0.831, 0.390, 0.000], [0.831, 0.369, 0.000], [0.831, 0.347, 0.000], [0.831, 0.325, 0.000]],
[[0.831, 0.325, 0.000], [0.814, 0.325, 0.000], [0.798, 0.325, 0.000], [0.782, 0.325, 0.000]],
[[0.782, 0.325, 0.000], [0.782, 0.297, 0.000], [0.782, 0.270, 0.000], [0.782, 0.242, 0.000]],
[[0.782, 0.242, 0.000], [0.782, 0.232, 0.000], [0.782, 0.225, 0.000], [0.784, 0.222, 0.000]],
[[0.784, 0.222, 0.000], [0.787, 0.217, 0.000], [0.792, 0.215, 0.000], [0.800, 0.215, 0.000]],
[[0.800, 0.215, 0.000], [0.806, 0.215, 0.000], [0.816, 0.216, 0.000], [0.828, 0.220, 0.000]],
[[0.828, 0.220, 0.000], [0.830, 0.200, 0.000], [0.832, 0.179, 0.000], [0.834, 0.158, 0.000]],
[[0.834, 0.158, 0.000], [0.812, 0.153, 0.000], [0.791, 0.151, 0.000], [0.772, 0.151, 0.000]],
[[0.772, 0.151, 0.000], [0.750, 0.151, 0.000], [0.733, 0.154, 0.000], [0.723, 0.160, 0.000]],
[[0.723, 0.160, 0.000], [0.712, 0.165, 0.000], [0.704, 0.174, 0.000], [0.699, 0.186, 0.000]],
[[0.699, 0.186, 0.000], [0.694, 0.197, 0.000], [0.692, 0.216, 0.000], [0.692, 0.243, 0.000]],
[[0.692, 0.243, 0.000], [0.692, 0.270, 0.000], [0.692, 0.297, 0.000], [0.692, 0.325, 0.000]],
[[0.692, 0.325, 0.000], [0.681, 0.325, 0.000], [0.670, 0.325, 0.000], [0.659, 0.325, 0.000]],
[[0.659, 0.325, 0.000], [0.659, 0.347, 0.000], [0.659, 0.369, 0.000], [0.659, 0.390, 0.000]],
[[0.659, 0.390, 0.000], [0.670, 0.390, 0.000], [0.681, 0.390, 0.000], [0.692, 0.390, 0.000]],
[[0.692, 0.390, 0.000], [0.692, 0.405, 0.000], [0.692, 0.419, 0.000], [0.692, 0.433, 0.000]],
[[0.692, 0.433, 0.000], [0.722, 0.449, 0.000], [0.752, 0.464, 0.000], [0.782, 0.479, 0.000]]],
[[[0.273, 0.002, 0.000], [0.126, 0.002, 0.000], [0.002, 0.017, 0.000], [0.002, 0.273, 0.000]],
[[0.002, 0.273, 0.000], [0.002, 0.424, 0.000], [0.002, 0.576, 0.000], [0.002, 0.727, 0.000]],
[[0.002, 0.727, 0.000], [0.002, 0.919, 0.000], [0.126, 0.999, 0.000], [0.273, 0.999, 0.000]],
[[0.273, 0.999, 0.000], [0.483, 0.999, 0.000], [0.692, 0.999, 0.000], [0.902, 0.999, 0.000]],
[[0.902, 0.999, 0.000], [1.095, 0.999, 0.000], [1.173, 0.919, 0.000], [1.173, 0.727, 0.000]],
[[1.173, 0.727, 0.000], [1.173, 0.576, 0.000], [1.173, 0.424, 0.000], [1.173, 0.273, 0.000]],
[[1.173, 0.273, 0.000], [1.173, 0.017, 0.000], [1.095, 0.002, 0.000], [0.902, 0.002, 0.000]],
[[0.902, 0.002, 0.000], [0.692, 0.002, 0.000], [0.483, 0.002, 0.000], [0.273, 0.002, 0.000]]]],
'SHIFT': [[[[0.273, 0.002, 0.000], [0.126, 0.002, 0.000], [0.002, 0.017, 0.000], [0.002, 0.273, 0.000]],
[[0.002, 0.273, 0.000], [0.002, 0.424, 0.000], [0.002, 0.576, 0.000], [0.002, 0.727, 0.000]],
[[0.002, 0.727, 0.000], [0.002, 0.919, 0.000], [0.126, 0.999, 0.000], [0.273, 0.999, 0.000]],
[[0.273, 0.999, 0.000], [0.483, 0.999, 0.000], [0.692, 0.999, 0.000], [0.902, 0.999, 0.000]],
[[0.902, 0.999, 0.000], [1.095, 0.999, 0.000], [1.173, 0.919, 0.000], [1.173, 0.727, 0.000]],
[[1.173, 0.727, 0.000], [1.173, 0.576, 0.000], [1.173, 0.424, 0.000], [1.173, 0.273, 0.000]],
[[1.173, 0.273, 0.000], [1.173, 0.017, 0.000], [1.095, 0.002, 0.000], [0.902, 0.002, 0.000]],
[[0.902, 0.002, 0.000], [0.692, 0.002, 0.000], [0.483, 0.002, 0.000], [0.273, 0.002, 0.000]]],
[[[0.539, 0.146, 0.000], [0.452, 0.146, 0.000], [0.365, 0.146, 0.000], [0.277, 0.146, 0.000]],
[[0.277, 0.146, 0.000], [0.277, 0.221, 0.000], [0.277, 0.297, 0.000], [0.277, 0.373, 0.000]],
[[0.277, 0.373, 0.000], [0.258, 0.373, 0.000], [0.204, 0.373, 0.000], [0.160, 0.373, 0.000]],
[[0.160, 0.373, 0.000], [0.243, 0.456, 0.000], [0.325, 0.539, 0.000], [0.408, 0.622, 0.000]],
[[0.408, 0.622, 0.000], [0.491, 0.539, 0.000], [0.574, 0.456, 0.000], [0.656, 0.373, 0.000]],
[[0.656, 0.373, 0.000], [0.612, 0.373, 0.000], [0.559, 0.373, 0.000], [0.539, 0.373, 0.000]],
[[0.539, 0.373, 0.000], [0.539, 0.297, 0.000], [0.539, 0.221, 0.000], [0.539, 0.146, 0.000]]]],
}
def __init__(self):
super(KeyboardDisplay, self).__init__('Keyboard', self._keys_shapes)
self._detector = KeyboardActionDetector()
self.set_size(150)
pass
def process_event(self, event):
#Check for action
act = self._detector.detect_action(event)
if act:
self.process_action(act)
def process_action(self, action):
if action.device == 'Keyboard':
self.add_action(action)
def _calc_alpha(self, action_time):
cur_time = time.time()
return .5 - .5 / (1 + math.exp(-6 * (cur_time - action_time - 3.0)))
def _get_alpha(self, status, calcd_alpha):
alpha = calcd_alpha
if not status or calcd_alpha < 0.025:
alpha = 0.025
return alpha
def draw_display(self, region_width):
super(KeyboardDisplay, self).draw_display()
cur_time = time.time()
recent_events = self._actions_logger.get_recent_events(4.5)
latest_event = recent_events[-1] if len(recent_events) else None
if latest_event and cur_time - latest_event.timestamp < 4.5:
action = latest_event.get_content()
alpha = self._calc_alpha(latest_event.timestamp)
bgl.glEnable(bgl.GL_BLEND)
#Draw modifiers row
modifiers_size = self._size / 3
ctrl_alpha = self._get_alpha(action.ctrl, alpha)
alt_alpha = self._get_alpha(action.alt, alpha)
shift_alpha = self._get_alpha(action.shift, alpha)
ctrl_bounds = self.calc_widget_screen_size('CTRL', modifiers_size)
alt_bounds = self.calc_widget_screen_size('ALT', modifiers_size)
shift_bounds = self.calc_widget_screen_size('SHIFT', modifiers_size)
v_gutter = ctrl_bounds['height'] * 0.25
h_gutter = ctrl_bounds['height'] * 0.25
row1_width = ctrl_bounds['width'] * 3 + h_gutter * 2
row1_offset = (region_width - row1_width) / 2
ctrl_offset = [row1_offset, v_gutter]
alt_offset = [ctrl_offset[0] + ctrl_bounds['width'] + h_gutter, v_gutter]
shift_offset = [alt_offset[0] + alt_bounds['width'] + h_gutter, v_gutter]
#Draw CTRL
bgl.glColor4f(1.0, 1.0, 1.0, ctrl_alpha)
self._widgets['CTRL'].draw_widget(modifiers_size, ctrl_offset)
#Draw ALT
bgl.glColor4f(1.0, 1.0, 1.0, alt_alpha)
self._widgets['ALT'].draw_widget(modifiers_size, alt_offset)
#Draw SHIFT
bgl.glColor4f(1.0, 1.0, 1.0, shift_alpha)
self._widgets['SHIFT'].draw_widget(modifiers_size, shift_offset)
#Draw main key
main_alpha = self._get_alpha(True, alpha)
main_key_bounds = self.calc_widget_screen_size(action.type, self._size)
row2_width = main_key_bounds['width']
row2_offset = (region_width - row2_width) / 2
main_key_offset = [row2_offset, ctrl_bounds['height']*1.5]
bgl.glColor4f(1.0, 1.0, 1.0, main_alpha)
self._widgets[action.type].draw_widget(self._size, main_key_offset)
class HistoryDisplay(KeyboardDisplay):
def __init__(self):
super(KeyboardDisplay, self).__init__('History', self._keys_shapes)
self._keyboard_detector = KeyboardActionDetector()
self._mouse_detector = MouseActionDetector()
self.set_size(30)
pass
def process_event(self, event):
key_act = self._keyboard_detector.detect_action(event)
if key_act:
self.process_action(key_act)
mouse_act = self._mouse_detector.detect_action(event)
if mouse_act:
self.process_action(mouse_act)
def process_action(self, action):
print("*"*10)
print("Adding action to history")
self.add_action(action)
def draw_display(self):
print("="*20)
print("Drawing {} display. Actions logged:".format(self._id))
print(str(self._actions_logger))
class Action:
ctrl = False
alt = False
shift = False
type = ''
device = 'NONE'
def __init__(self):
pass
def get_signature(self):
signature_items = []
signature_items.append('Ctrl' if self.ctrl else '')
signature_items.append('Alt' if self.alt else '')
signature_items.append('Shift' if self.shift else '')
signature_items.append(self.type)
return "+".join([k for k in signature_items if k != ''])
def __str__(self):
return self.get_signature()
class ActionDetector:
detected_types = []
def __init__(self, types = None):
if types is not None: self.detected_types = types
pass