Allow Style.matrix to handle one or two values
This commit is contained in:
parent
cf6032084c
commit
453ec634c7
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -131,23 +131,26 @@ Style =
|
|||||||
|
|
||||||
matrix: (foreground, background) ->
|
matrix: (foreground, background) ->
|
||||||
fgHex = Style.colorToHex foreground
|
fgHex = Style.colorToHex foreground
|
||||||
bgHex = Style.colorToHex background
|
fg = {
|
||||||
|
|
||||||
[{
|
|
||||||
r: parseInt(fgHex.substr(0, 2), 16) / 255
|
r: parseInt(fgHex.substr(0, 2), 16) / 255
|
||||||
g: parseInt(fgHex.substr(2, 2), 16) / 255
|
g: parseInt(fgHex.substr(2, 2), 16) / 255
|
||||||
b: parseInt(fgHex.substr(4, 2), 16) / 255
|
b: parseInt(fgHex.substr(4, 2), 16) / 255
|
||||||
},
|
}
|
||||||
{
|
if background
|
||||||
r: parseInt(bgHex.substr(0, 2), 16) / 255
|
bgHex = Style.colorToHex background
|
||||||
g: parseInt(bgHex.substr(2, 2), 16) / 255
|
|
||||||
b: parseInt(bgHex.substr(4, 2), 16) / 255
|
bg = {
|
||||||
}]
|
r: parseInt(bgHex.substr(0, 2), 16) / 255
|
||||||
|
g: parseInt(bgHex.substr(2, 2), 16) / 255
|
||||||
|
b: parseInt(bgHex.substr(4, 2), 16) / 255
|
||||||
|
}
|
||||||
|
|
||||||
|
[fg, bg or fg]
|
||||||
|
|
||||||
filter: ([fg, bg]) ->
|
filter: ([fg, bg]) ->
|
||||||
"#{bg.r} #{-fg.r} 0 0 #{fg.r} #{bg.g} #{-fg.g} 0 0 #{fg.g} #{bg.b} #{-fg.b} 0 0 #{fg.b}"
|
"#{bg.r} #{-fg.r} 0 0 #{fg.r} #{bg.g} #{-fg.g} 0 0 #{fg.g} #{bg.b} #{-fg.b} 0 0 #{fg.b}"
|
||||||
|
|
||||||
silhouette: ([fg, bg]) ->
|
silhouette: ([fg]) ->
|
||||||
"0 0 0 0 #{fg.r} 0 0 0 0 #{fg.g} 0 0 0 0 #{fg.b}"
|
"0 0 0 0 #{fg.r} 0 0 0 0 #{fg.g} 0 0 0 0 #{fg.b}"
|
||||||
|
|
||||||
layout: """<%= grunt.file.read('src/General/css/layout.css') %>"""
|
layout: """<%= grunt.file.read('src/General/css/layout.css') %>"""
|
||||||
@ -179,7 +182,7 @@ Style =
|
|||||||
|
|
||||||
Style.svg.innerHTML = """
|
Style.svg.innerHTML = """
|
||||||
<svg xmlns='http://www.w3.org/2000/svg' height=0><filter id='captcha-filter' color-interpolation-filters='sRGB'><feColorMatrix values='#{Style.filter Style.matrix theme["Text"], theme["Input Background"]} 0 0 0 1 0' /></filter></svg>
|
<svg xmlns='http://www.w3.org/2000/svg' height=0><filter id='captcha-filter' color-interpolation-filters='sRGB'><feColorMatrix values='#{Style.filter Style.matrix theme["Text"], theme["Input Background"]} 0 0 0 1 0' /></filter></svg>
|
||||||
<svg xmlns='http://www.w3.org/2000/svg' height=0><filter id='mascot-filter' color-interpolation-filters='sRGB'><feColorMatrix values='#{Style.silhouette Style.matrix theme["Reply Background"], theme["Reply Background"]} 0 0 0 1 0' /></filter></svg>
|
<svg xmlns='http://www.w3.org/2000/svg' height=0><filter id='mascot-filter' color-interpolation-filters='sRGB'><feColorMatrix values='#{Style.silhouette Style.matrix theme["Reply Background"]} 0 0 0 1 0' /></filter></svg>
|
||||||
<svg xmlns='http://www.w3.org/2000/svg' height=0><filter id="grayscale"><feColorMatrix id="color" type="saturate" values="0" /></filter></svg>
|
<svg xmlns='http://www.w3.org/2000/svg' height=0><filter id="grayscale"><feColorMatrix id="color" type="saturate" values="0" /></filter></svg>
|
||||||
<svg xmlns='http://www.w3.org/2000/svg' height=0><filter id="icons-filter" color-interpolation-filters='sRGB'><feColorMatrix values='-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0' /></filter></svg>
|
<svg xmlns='http://www.w3.org/2000/svg' height=0><filter id="icons-filter" color-interpolation-filters='sRGB'><feColorMatrix values='-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0' /></filter></svg>
|
||||||
"""
|
"""
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user