sources/coloredline.cpp

changeset 100
d301ead29d7c
parent 88
08ccaf26cffd
child 106
7b156b764d11
child 109
e4966d7e615d
equal deleted inserted replaced
99:f9f73eeba3b7 100:d301ead29d7c
135 135
136 // ------------------------------------------------------------------------------------------------- 136 // -------------------------------------------------------------------------------------------------
137 // 137 //
138 void ColoredLine::set_color (Color a, bool on) 138 void ColoredLine::set_color (Color a, bool on)
139 { 139 {
140 switch (a) 140 assert (a < 8);
141 { 141 m_data << (a + (on ? RLINE_ON_COLOR : RLINE_OFF_COLOR));
142 case BLACK: m_data << (on ? RLINE_ON_BLACK : RLINE_OFF_BLACK); break;
143 case RED: m_data << (on ? RLINE_ON_RED : RLINE_OFF_RED); break;
144 case GREEN: m_data << (on ? RLINE_ON_GREEN : RLINE_OFF_GREEN); break;
145 case YELLOW: m_data << (on ? RLINE_ON_YELLOW : RLINE_OFF_YELLOW); break;
146 case BLUE: m_data << (on ? RLINE_ON_BLUE : RLINE_OFF_BLUE); break;
147 case MAGENTA: m_data << (on ? RLINE_ON_MAGENTA : RLINE_OFF_MAGENTA); break;
148 case CYAN: m_data << (on ? RLINE_ON_CYAN : RLINE_OFF_CYAN); break;
149 case WHITE: m_data << (on ? RLINE_ON_WHITE : RLINE_OFF_WHITE); break;
150 case NUM_COLORS:
151 case DEFAULT: assert (false); break;
152 }
153 } 142 }
154 143
155 // ------------------------------------------------------------------------------------------------- 144 // -------------------------------------------------------------------------------------------------
156 // How many rows does this line take up? 145 // How many rows does this line take up?
157 // 146 //

mercurial