-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrgbaParse_alpha.tcl
36 lines (36 loc) · 941 Bytes
/
rgbaParse_alpha.tcl
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
#brMap
#rgbaParse_alpha.tcl
##===================================================================
# Copyright (c) 2019 Yuji SODE <[email protected]>
#
# This software is released under the MIT License.
# See LICENSE or http://opensource.org/licenses/mit-license.php
##===================================================================
#Tool that converts a linear list of RGBa color values into a numerical list.
#
#--- [Parsing rule] ---
#RGBa color: (R,G,B,a) => a
#where R, G, B and a are 0 to 255
#
#=== Synopsis ===
#`rgbaParse_alpha rgba;`
#
#--- Parameters ---
# - $rgba: a list of RGBa color values (0 to 255)
##===================================================================
#
proc rgbaParse_alpha rgba {
# - $rgba: a list of RGBa color values (0 to 255)
#
set l $rgba;
set n [llength $l];
set i 0;
set v {};
#
while {$i<$n} {
#alpha value of RGBa color
lappend v [lindex $l $i+3];
incr i 4;
};
return $v;
};