Commit d7cad2dbd675a41385dd9d8ee18aebd8ae746f82

Authored by Paulo Henrique Junqueira Amorim
1 parent 930822b3

FIX: Bug change colour if not selected preset

Showing 1 changed file with 4 additions and 3 deletions   Show diff stats
invesalius/data/volume.py
... ... @@ -375,9 +375,10 @@ class Volume():
375 375 return colour
376 376  
377 377 def ChangeBackgroundColour(self, pubsub_evt):
378   - self.config['backgroundColorRedComponent'] = pubsub_evt.data[0] * 255
379   - self.config['backgroundColorGreenComponent'] = pubsub_evt.data[1] * 255
380   - self.config['backgroundColorBlueComponent'] = pubsub_evt.data[2] * 255
  378 + if (self.config):
  379 + self.config['backgroundColorRedComponent'] = pubsub_evt.data[0] * 255
  380 + self.config['backgroundColorGreenComponent'] = pubsub_evt.data[1] * 255
  381 + self.config['backgroundColorBlueComponent'] = pubsub_evt.data[2] * 255
381 382  
382 383 def BuildTable():
383 384 curve_table = p['16bitClutCurves']
... ...