sisl / AutoViz.jl

Provides visualization tools for AutomotiveDrivingModels. Built on Cairo
Other
33 stars 9 forks source link

randomized colors for entities based on id hash #44

Closed mattuntergassmair closed 4 years ago

mattuntergassmair commented 4 years ago

The current add_renderable! function for the Entity type uses a randomized color, which differs in every function call and leads to inconsistent colors between time frames. This PR bases the color randomization on the hash of the entity id and is therefore consistent for vehicles with the same id.

coveralls commented 4 years ago

Coverage Status

Coverage increased (+12.4%) to 55.347% when pulling 36d40564390966a545f8b7b764be135ff7b71929 on mattuntergassmair:v0.8_random_color_hash into 6125e87842004d71d37e5b0efa14d8898071cc35 on sisl:v0.8.

MaximeBouton commented 4 years ago

Fancy! what kind of colors does that give us?

mattuntergassmair commented 4 years ago

Fancy! what kind of colors does that give us?

I guess we can be arbitrarily specific about the colors we want, right now I've done the following: For every color channel (R, G, B), the value is determined as .3 + .7x where x are some bits from the id-hash and .3 is a minimum value, so the "darkest" possible color is RGB(.3,.3,.3).

MaximeBouton commented 4 years ago

Is it good to merge?