Skip to content

Syntax Highlighting Guidelines

The Rosely colour palette can be easily used for syntax highlighting using guidelines similar to Base16

base16 is an architecture for building themes based on carefully chosen syntax highlighting using a base of sixteen colours. Base16 provides a set of guidelines detailing how to style syntax and how to code a builder for compiling base16 schemes and templates.

Rosely is not completely compatible with base16 (although it is possible to get base16 compliance by rearranging the colour palette) but a similar technique can be used for syntax highlighting. The aim is to group similar language constructs with a single color. For example, floats, ints, and doubles would belong to the same colour group.

The following are base16 guidelines for syntax highlighting adapted for Rosely (colours are selected from the ANSI palette to be consistent with syntax highlighting on terminal):

base16Syntax highlighting elementsColour
base08Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deletedbright red
base09Integers, Boolean, Constants, XML Attributes, Markup Link Urlgreen
base0AClasses, Markup Bold, Search Text Backgroundbright magenta
base0BStrings, Inherited Class, Markup Code, Diff Insertedbright green
base0CSupport, Regular Expressions, Escape Characters, Markup Quotescyan
base0DFunctions, Methods, Attribute IDs, Headingsblue
base0EKeywords, Storage, Selector, Markup Italic, Diff Changedmagenta
base0FDeprecated, Opening/Closing Embedded Language Tags, e.g. white