summaryrefslogtreecommitdiff
path: root/source/style/package.d
blob: 2e5ff7f18dbc869006943daa6d0d7d75150c5bf5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module style;

import std.conv;

import style.color;

string set(string s, int code) {
  return ("%{\x1b[" ~ to!string(code) ~ "m%}") ~ s ~ (
    "%{\x1b[" ~ to!string((Color.reset + 0)) ~ "m%}");
}

string set(string s, int code, bool close) {
  return ("%{\x1b[" ~ to!string(code) ~ "m%}") ~ s ~ (close ? (
      "%{\x1b[" ~ to!string((Color.reset + 0)) ~ "m%}") : "");
}