diff --git a/src/stretchy.js b/src/stretchy.js index d5570f88..52b8a2ad 100644 --- a/src/stretchy.js +++ b/src/stretchy.js @@ -143,7 +143,7 @@ const svgSpan = function(group, options) { classArray.push("mask"); // Over-ride image. classArray.push(fileName + "-mask"); // Set mask-image. node = buildCommon.makeSpan(classArray, [], options); - node.style.backgroundColor = options.color; + node.style.backgroundColor = options.getColor(); } else { classArray.push(fileName); // Set image and span height. node = buildCommon.makeSpan(classArray, [], options); @@ -161,10 +161,10 @@ const encloseSpan = function(inner, isCharBox, label, pad, options) { if (options.color) { if (label === "fbox") { - img.style.borderColor = options.color; + img.style.borderColor = options.getColor(); } else { img.classes[2] = label + "-mask"; - img.style.backgroundColor = options.color; + img.style.backgroundColor = options.getColor(); } } diff --git a/static/katex.less b/static/katex.less index 28eae041..687cf1a1 100644 --- a/static/katex.less +++ b/static/katex.less @@ -853,9 +853,12 @@ // This section won't be applied by some older browsers, so they will instead // render the black background-image defined above. - .mask { - background-image: none; - } + .mask, + .bcancel-mask, + .cancel-mask, + .xcancel-mask { + background-image: none; + } } @supports not ((mask-image:none) or (-webkit-mask:none)) { diff --git a/test/screenshotter/images/StretchyAccentColor-chrome.png b/test/screenshotter/images/StretchyAccentColor-chrome.png new file mode 100644 index 00000000..c9561712 Binary files /dev/null and b/test/screenshotter/images/StretchyAccentColor-chrome.png differ diff --git a/test/screenshotter/images/StretchyAccentColor-firefox.png b/test/screenshotter/images/StretchyAccentColor-firefox.png new file mode 100644 index 00000000..4a14cb97 Binary files /dev/null and b/test/screenshotter/images/StretchyAccentColor-firefox.png differ diff --git a/test/screenshotter/images/StrikeThroughColor-chrome.png b/test/screenshotter/images/StrikeThroughColor-chrome.png new file mode 100644 index 00000000..cd0c944a Binary files /dev/null and b/test/screenshotter/images/StrikeThroughColor-chrome.png differ diff --git a/test/screenshotter/images/StrikeThroughColor-firefox.png b/test/screenshotter/images/StrikeThroughColor-firefox.png new file mode 100644 index 00000000..6374fb47 Binary files /dev/null and b/test/screenshotter/images/StrikeThroughColor-firefox.png differ diff --git a/test/screenshotter/ss_data.yaml b/test/screenshotter/ss_data.yaml index 32c1fe9c..c1ac2e7c 100644 --- a/test/screenshotter/ss_data.yaml +++ b/test/screenshotter/ss_data.yaml @@ -52,8 +52,8 @@ Cases: | Colors: tex: \blue{a}\textcolor{#0f0}{b}\textcolor{red}{c} nolatex: different syntax and different scope -ColorSpacing: \textcolor{red}{\displaystyle \int x} + 1 ColorImplicit: bl{ack\color{red}red\textcolor{green}{green}red\color{blue}blue}black +ColorSpacing: \textcolor{red}{\displaystyle \int x} + 1 DashesAndQuotes: \text{``a'' b---c -- d----`e'-{-}-f}--``x'' DeepFontSizing: tex: | @@ -203,6 +203,8 @@ StretchyAccent: | \overrightarrow{F} + \overrightarrow{AB} + \overrightarrow{F}^2 + \overrightarrow{F}_2 + \overrightarrow{F}_1^2 \\ \overrightarrow{AB}^2+\frac{\overrightarrow{AB}}{\overrightarrow{AB}} + \sqrt{\overrightarrow{AB}} + \left\lvert\overrightarrow{AB}\right\rvert \end{array} +StretchyAccentColor: | + \red{\overrightarrow{AB}} \quad \color{blue}{\overleftarrow{AB}} \quad \color{blue}{\green{\Overrightarrow{AB}}} StrikeThrough: | \begin{array}{l} \cancel x \quad \cancel{2B} + \bcancel 5 +\bcancel{5ay} \\ @@ -210,6 +212,11 @@ StrikeThrough: | \frac{x+\cancel B}{x+\cancel x} + \frac{x+\cancel y}{x} + \cancel{B}_1^2 + \cancel{B^2} \\ \left\lvert\cancel{ac}\right\rvert \end{array} +StrikeThroughColor: | + \begin{array}{l} + \red{\cancel x \quad \cancel{2B} + \bcancel 5 +\bcancel{5ay}} \\ + \color{green}{\sout{5ab} + \sout{5ABC} + \xcancel{\oint_S{\vec E\cdot\hat n\,\mathrm d a}}} + \end{array} StyleSpacing: \scriptstyle ab\;cd StyleSwitching: a\cdot b\scriptstyle a\cdot ba\textstyle\cdot ba\scriptstyle\cdot b SupSubCharacterBox: a_2f_2{f}_2{aa}_2{af}_2\mathbf{y}_Ay_A