The CMYK (Cyan, Magenta, Yellow, blacK) color model is widely used in printed media – just as the RGB (Red, Green, Blue) model used for on-screen colors. This is a simple RGB-to-CMYK color converter function.

Processing.js is the sister project of the popular Processing visual programming language, designed for the web. Processing.js makes your data visualizations, digital art, interactive animations, educational graphs, video games, etc. work using web standards and without any plug-ins. You write code using the Processing language, include it in your web page, and Processing.js does the rest. It's not magic, but almost.

So, I wrote a syntax highlighter. The answer is because it was fun. And also because I was displeased with the inadequacy of other ones, such as Syntax Highlighter and Prettify.

Specifically, those highlighters rely on hideously complicated regular expressions, which works in a general kind of case, but most languages are a bit more sophisticated than just having keywords. For example, in C#, there are contextual keywords (like get, set and value) that are keywords only when used in a certain context. Obviously a regular expression isn’t going to be able to detect that kind of idiosyncrasy.