Add a \color command for custom colors

Summary:
Keep track of the color inside the style now, and use that when we are
rendering things. Added a custom lexing mode to handle lexing colors correctly.
Prefixed the old katex colors (internally) with "katex-" to distinguish them
from CSS colors.

Test Plan:
 - Run the normal tests, see they work
 - Run the huxley tests, see that they didn't change except for the color one
   which looks right

Reviewers: alpert

Reviewed By: alpert

Differential Revision: http://phabricator.khanacademy.org/D7763
This commit is contained in:
Emily Eisenberg
2014-03-27 12:34:45 -04:00
parent 7723d3dcaf
commit d729ba5281
8 changed files with 159 additions and 31 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

View File

@@ -11,7 +11,7 @@ url=http://localhost:7936/test/huxley/test.html?m=\dfrac{\frac{a}{b}}{\frac{c}{d
url=http://localhost:7936/test/huxley/test.html?m=a^{a^a_a}_{a^a_a}
[Colors]
url=http://localhost:7936/test/huxley/test.html?m=\blue{a}\green{b}\red{c}
url=http://localhost:7936/test/huxley/test.html?m=\blue{a}\color{%%230f0}{b}\color{red}{c}
[GreekLetters]
url=http://localhost:7936/test/huxley/test.html?m=\alpha\beta\gamma\omega