nschloe/matlab2tikz — pull request #284 by egeerardyn (2013-12-25 23:56:38+00:00)
Title: Color mixtures & import custom colors

Next to the extraColors feature (as in #268), this branch contains an implementation for color mixtures such as `red!70!green`.
The main implementation was in e8bf7b8, the code may be somewhat terse, but a more elaborate mathematical derivation is present in the commit message.
Some points of attention:

* it is conservative in making a color mix: when it is in doubt (i.e. one R/G/B component deviates too much), it will not make the mixture,
* it depends on the ordering of the colors: if `red` appears before `green` in the defined color list, a combination `green!40!red` will never be made (but `red!60!green` will), this can also affect runtime, as in general, the runtime is O(n^2) with n the number of defined colors.

The runtime issue is mitigated pragmatically in e2a23b3: `white` and `black` should be the most commonly used, so they have been put at the beginning: resulting in a reduced runtime for those.

In 23960ed, it was made sure that defined colors are preferred over mixtures, otherwise, colors such as `darkgray` (i.e. mixture between black and white) would be dead code. More resulting dead code was removed in 94a4135.