Skip to content

Commit

Permalink
Improve data view performance by limiting colors. (#1070)
Browse files Browse the repository at this point in the history
  • Loading branch information
corranwebster authored Jan 7, 2022
1 parent c2d9119 commit f02e9c6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions examples/data_view/example_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
in examples.
"""

from random import choice, randint, uniform
from random import choice, randint

from pyface.color import Color

Expand Down Expand Up @@ -51,6 +51,10 @@
'Montague', 'Miller',
]

favorite_colors = [
Color(hsv=(hue/100, 1.0, 1.0))
for hue in range(100)
]

def any_name():
return choice(all_names)
Expand All @@ -65,7 +69,7 @@ def age():


def favorite_color():
return Color(hsv=(uniform(0.0, 1.0), 1.0, 1.0))
return choice(favorite_colors)


def street():
Expand Down

0 comments on commit f02e9c6

Please sign in to comment.