blob: f94abe04a2a059fbfa5db2e02f3dbac71a1beb4a [file] [log] [blame] [raw]
define(function (require) {
"use strict";
var NumRainbowColours = 12;
function clearBackground(editor) {
for (var i = 0; i < editor.lineCount(); ++i) {
editor.removeLineClass(i, "background", null);
}
}
function applyColours(editor, colours) {
editor.operation(function () {
clearBackground(editor);
_.each(colours, function (ordinal, line) {
editor.addLineClass(parseInt(line),
"background", "rainbow-" + (ordinal % NumRainbowColours));
});
});
}
return {
applyColours: applyColours,
clearBackground: clearBackground
};
});