markwatkinson / luminous

Accurate and powerful syntax highlighting library
http://luminous.asgaard.co.uk
GNU Lesser General Public License v2.1
51 stars 5 forks source link

Make the ANSI formatter use xterm256color codes by default #38

Closed J5lx closed 9 years ago

J5lx commented 9 years ago

This is the fix for #36. It utilises lots of really expensive and really complicated algorithms (which make my head ache) to add lots of really fancy colours in most terminal emulators. The new option colorDistanceAlgorithm can be used to choose from several available algorithms:

Since this requires so many colour-related functions (not just the colour distance algorithms themselves), I created a new class Luminous\Utils\ColorUtils for them.

markwatkinson commented 9 years ago

Looks good, thanks, I've merged it in.

I made a small change to fix the same compatibility issue as we had yesterday with const arrays.