mirror of
https://github.com/discourse/discourse.git
synced 2025-03-20 08:17:49 +08:00
minor refactoring (#6615)
This commit is contained in:
parent
dcc6527dff
commit
078705bcc0
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user