| 202 | } |
| 203 | |
| 204 | void ColorScheme::readFromConfig(Confparse &obvconfig) { |
| 205 | const char *v = obvconfig.ParseStr("colorTheme", "light"); |
| 206 | ThemeSetStyle(v); |
| 207 | |
| 208 | /* |
| 209 | * Colours in ImGui can be represented as a 4-byte packed uint32_t as ABGR |
| 210 | * but most humans are more accustomed to RBGA, so for the sake of readability |
| 211 | * we use the human-readable version but swap the ordering around when |
| 212 | * it comes to assigning the actual colour to ImGui. |
| 213 | */ |
| 214 | |
| 215 | /* |
| 216 | * XRayBlue theme |
| 217 | */ |
| 218 | |
| 219 | this->backgroundColor = byte4swap(obvconfig.ParseHex("backgroundColor", byte4swap(this->backgroundColor))); |
| 220 | this->boardFillColor = byte4swap(obvconfig.ParseHex("boardFillColor", byte4swap(this->boardFillColor))); |
| 221 | |
| 222 | this->partHullColor = byte4swap(obvconfig.ParseHex("partHullColor", byte4swap(this->partHullColor))); |
| 223 | this->partOutlineColor = byte4swap(obvconfig.ParseHex("partOutlineColor", byte4swap(this->partOutlineColor))); |
| 224 | this->partFillColor = byte4swap(obvconfig.ParseHex("partFillColor", byte4swap(this->partFillColor))); |
| 225 | this->partTextColor = byte4swap(obvconfig.ParseHex("partTextColor", byte4swap(this->partTextColor))); |
| 226 | this->partHighlightedColor = byte4swap(obvconfig.ParseHex("partHighlightedColor", byte4swap(this->partHighlightedColor))); |
| 227 | this->partHighlightedFillColor = |
| 228 | byte4swap(obvconfig.ParseHex("partHighlightedFillColor", byte4swap(this->partHighlightedFillColor))); |
| 229 | this->partHighlightedTextColor = byte4swap(obvconfig.ParseHex("partHighlightedTextColor", byte4swap(this->partHighlightedTextColor))); |
| 230 | this->partHighlightedTextBackgroundColor = |
| 231 | byte4swap(obvconfig.ParseHex("partHighlightedTextBackgroundColor", byte4swap(this->partHighlightedTextBackgroundColor))); |
| 232 | this->boardOutlineColor = byte4swap(obvconfig.ParseHex("boardOutlineColor", byte4swap(this->boardOutlineColor))); |
| 233 | this->pinDefaultColor = byte4swap(obvconfig.ParseHex("pinDefaultColor", byte4swap(this->pinDefaultColor))); |
| 234 | this->pinDefaultTextColor = byte4swap(obvconfig.ParseHex("pinDefaultTextColor", byte4swap(this->pinDefaultTextColor))); |
| 235 | this->pinTextBackgroundColor = byte4swap(obvconfig.ParseHex("pinTextBackgroundColor", byte4swap(this->pinTextBackgroundColor))); |
| 236 | this->pinGroundColor = byte4swap(obvconfig.ParseHex("pinGroundColor", byte4swap(this->pinGroundColor))); |
| 237 | this->pinNotConnectedColor = byte4swap(obvconfig.ParseHex("pinNotConnectedColor", byte4swap(this->pinNotConnectedColor))); |
| 238 | this->pinTestPadColor = byte4swap(obvconfig.ParseHex("pinTestPadColor", byte4swap(this->pinTestPadColor))); |
| 239 | this->pinTestPadFillColor = byte4swap(obvconfig.ParseHex("pinTestPadFillColor", byte4swap(this->pinTestPadFillColor))); |
| 240 | this->pinA1PadColor = byte4swap(obvconfig.ParseHex("pinA1PadColor", byte4swap(this->pinA1PadColor))); |
| 241 | |
| 242 | this->pinSelectedTextColor = byte4swap(obvconfig.ParseHex("pinSelectedTextColor", byte4swap(this->pinSelectedTextColor))); |
| 243 | this->pinSelectedFillColor = byte4swap(obvconfig.ParseHex("pinSelectedFillColor", byte4swap(this->pinSelectedFillColor))); |
| 244 | this->pinSelectedColor = byte4swap(obvconfig.ParseHex("pinSelectedColor", byte4swap(this->pinSelectedColor))); |
| 245 | |
| 246 | this->pinSameNetTextColor = byte4swap(obvconfig.ParseHex("pinSameNetTextColor", byte4swap(this->pinSameNetTextColor))); |
| 247 | this->pinSameNetFillColor = byte4swap(obvconfig.ParseHex("pinSameNetFillColor", byte4swap(this->pinSameNetFillColor))); |
| 248 | this->pinSameNetColor = byte4swap(obvconfig.ParseHex("pinSameNetColor", byte4swap(this->pinSameNetColor))); |
| 249 | |
| 250 | this->pinHaloColor = byte4swap(obvconfig.ParseHex("pinHaloColor", byte4swap(this->pinHaloColor))); |
| 251 | this->pinNetWebColor = byte4swap(obvconfig.ParseHex("pinNetWebColor", byte4swap(this->pinNetWebColor))); |
| 252 | |
| 253 | this->annotationPartAliasColor = |
| 254 | byte4swap(obvconfig.ParseHex("annotationPartAliasColor", byte4swap(this->annotationPartAliasColor))); |
| 255 | this->annotationBoxColor = byte4swap(obvconfig.ParseHex("annotationBoxColor", byte4swap(this->annotationBoxColor))); |
| 256 | this->annotationStalkColor = byte4swap(obvconfig.ParseHex("annotationStalkColor", byte4swap(this->annotationStalkColor))); |
| 257 | this->annotationPopupBackgroundColor = |
| 258 | byte4swap(obvconfig.ParseHex("annotationPopupBackgroundColor", byte4swap(this->annotationPopupBackgroundColor))); |
| 259 | this->annotationPopupTextColor = |
| 260 | byte4swap(obvconfig.ParseHex("annotationPopupTextColor", byte4swap(this->annotationPopupTextColor))); |
| 261 | |