| 1201 | } |
| 1202 | |
| 1203 | void ColorPicker::UpdateChannelSliderBackground(const ColorPickerSlider &slider, txmp::ColorChannel channel, txmp::ColorRepresentation representation) |
| 1204 | { |
| 1205 | if (slider) |
| 1206 | { |
| 1207 | // Regardless of the active color representation, the sliders always use HSV |
| 1208 | // Therefore, always calculate HSV color here |
| 1209 | // Warning: Always maintain/use HSV information in the saved HSV color |
| 1210 | // This avoids loss of precision and drift caused by continuously converting to/from RGB |
| 1211 | if (!m_SavedHsvColor) |
| 1212 | { |
| 1213 | const auto rgbColor = Color(); |
| 1214 | |
| 1215 | m_SavedHsvColor = Util::Color(rgbColor).ToHSV(); |
| 1216 | m_SavedHsvColorRgbEquivalent = rgbColor; |
| 1217 | } |
| 1218 | |
| 1219 | slider.IsAutoUpdatingEnabled(false); |
| 1220 | slider.ColorChannel(channel); |
| 1221 | slider.ColorRepresentation(representation); |
| 1222 | slider.HsvColor(*m_SavedHsvColor); |
| 1223 | slider.UpdateColors(); |
| 1224 | } |
| 1225 | } |
| 1226 | |
| 1227 | void ColorPicker::UpdateCustomPalette() |
| 1228 | { |
nothing calls this directly
no test coverage detected