| 155 | } |
| 156 | |
| 157 | void KeyboardDisplay::SetPitchColor(int pitch) |
| 158 | { |
| 159 | if (mShowScale) |
| 160 | { |
| 161 | if (TheScale->IsRoot(pitch)) |
| 162 | ofSetColor(0, 200, 0); |
| 163 | else if (TheScale->IsInPentatonic(pitch)) |
| 164 | ofSetColor(255, 128, 0); |
| 165 | else if (TheScale->IsInScale(pitch)) |
| 166 | ofSetColor(180, 80, 0); |
| 167 | else |
| 168 | ofSetColor(50, 50, 50); |
| 169 | } |
| 170 | else |
| 171 | { |
| 172 | int enableOffset = 0; |
| 173 | if (!IsEnabled()) |
| 174 | enableOffset = 80; |
| 175 | |
| 176 | pitch %= 12; |
| 177 | ofColor color; |
| 178 | if (pitch == 0 || pitch == 2 || pitch == 4 || pitch == 5 || pitch == 7 || pitch == 9 || pitch == 11) |
| 179 | color.setHsb(240, 145, 200 - enableOffset); |
| 180 | else |
| 181 | color.setHsb(240, 145, 120 - enableOffset); |
| 182 | ofSetColor(color); |
| 183 | } |
| 184 | } |
| 185 | |
| 186 | void KeyboardDisplay::Resize(float w, float h) |
| 187 | { |
nothing calls this directly
no test coverage detected