minor refactoring (#6615)

This commit is contained in:
Joffrey JAFFEUX 2018-11-15 21:41:05 +01:00 committed by GitHub
parent dcc6527dff
commit 078705bcc0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1325,12 +1325,12 @@ class Report
end
def rgba_color(hex, opacity = 1)
if hex.length === 3
if hex.size == 3
chars = hex.scan(/\w/)
hex = chars.zip(chars).flatten.join.ljust(6)
hex = chars.zip(chars).flatten.join
end
if hex.length < 3
if hex.size < 3
hex = hex.ljust(6, hex.last)
end