| 11 | mVelocity(0), mIdx(0), mEventTime(0) {} |
| 12 | |
| 13 | void Key::SetOn(uint8_t vel, const ColorHSV& color, uint32_t now_ms) { |
| 14 | if (mCurrColor.v_ < color.v_) { // if the new color is "brighter" than the current color. |
| 15 | mVelocity = vel; |
| 16 | mCurrColor = color; |
| 17 | mEventTime = now_ms; |
| 18 | } |
| 19 | mOrigColor = mCurrColor; |
| 20 | mEventTime = now_ms; |
| 21 | mOn = true; |
| 22 | } |
| 23 | |
| 24 | void Key::SetOff(uint32_t now_ms) { |
| 25 | mOrigColor = mCurrColor; |