mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Round alpha channel in TextMate theme rgba colors to 2-decimal places
This commit is contained in:
@@ -46,7 +46,7 @@ describe "TextMateTheme", ->
|
||||
expect(rulesets[2]).toEqual
|
||||
selector: '.editor.focused .selection'
|
||||
properties:
|
||||
'background-color': "rgba(221, 240, 255, .2)"
|
||||
'background-color': "rgba(221, 240, 255, 0.2)"
|
||||
|
||||
it "returns an array of objects representing the theme's scope selectors", ->
|
||||
expect(rulesets[11]).toEqual
|
||||
@@ -62,4 +62,4 @@ describe "TextMateTheme", ->
|
||||
selector: ".invalid-illegal"
|
||||
properties:
|
||||
'color': "#F8F8F8"
|
||||
'background-color': 'rgba(86, 45, 86, parseInt(textmateColor[7..8], 16))'
|
||||
'background-color': 'rgba(86, 45, 86, 0.75)'
|
||||
|
||||
@@ -105,4 +105,6 @@ class TextMateTheme
|
||||
g = parseInt(textmateColor[3..4], 16)
|
||||
b = parseInt(textmateColor[5..6], 16)
|
||||
a = parseInt(textmateColor[7..8], 16)
|
||||
"rgba(#{r}, #{g}, #{b}, #{a / 255.0})"
|
||||
a = Math.round((a / 255.0) * 100) / 100
|
||||
|
||||
"rgba(#{r}, #{g}, #{b}, #{a})"
|
||||
|
||||
Reference in New Issue
Block a user