Skip to content

Commit

Permalink
RGBA colors (with alpha)
Browse files Browse the repository at this point in the history
  • Loading branch information
nmichaud committed Jun 9, 2024
1 parent f342607 commit c14f657
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/colors.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ proc ::getColor {color} {
return [list {*}$output 1.0]
} elseif {[regexp {rgb\((\d+),(\d+),(\d+)\)} $color -> r g b]} {
return [list [/ $r 255.0] [/ $g 255.0] [/ $b 255.0] 1.0]
} elseif {[regexp {rgba\((\d+),(\d+),(\d+),(\d+\.\d+)} $color -> r g b a]} {
return [list [/ $r 255.0] [/ $g 255.0] [/ $b 255.0] $a]
} elseif {[regexp {0x([0-9A-Fa-f]{6})} $color -> hex]} {
return [hexcolor $hex]
} elseif {[regexp {0x([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])} $color -> r g b]} {
Expand Down

0 comments on commit c14f657

Please sign in to comment.