Properly translate hex colors from TextMate themes to rgba (divide alpha by 255)

This commit is contained in:
Nathan Sobo 2012-09-28 14:06:10 -06:00
parent 7c9f50209f
commit 4ba5ccb0fa
2 changed files with 3 additions and 3 deletions

View File

@ -46,7 +46,7 @@ describe "TextMateTheme", ->
expect(rulesets[2]).toEqual
selector: '.editor.focused .selection'
properties:
'background-color': "rgba(221, 240, 255, 51)"
'background-color': "rgba(221, 240, 255, .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, 191)'
'background-color': 'rgba(86, 45, 86, parseInt(textmateColor[7..8], 16))'

View File

@ -105,4 +105,4 @@ 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})"
"rgba(#{r}, #{g}, #{b}, #{a / 255.0})"