scenic.simulators.utils.colors

A basic color type.

This used for example to represent car colors in the abstract driving domain, as well as in the interfaces to GTA and Webots.

Summary of Module Members

Classes

Color

A color as an RGB tuple.

ColorMutator

Mutator that adds Gaussian HSL noise to the color property.

NoisyColorDistribution

A distribution given by HSL noise around a base color.

Member Details

class Color(r, g, b)[source]

Bases: scenic.simulators.utils.colors.Color

A color as an RGB tuple.

static uniformColor()[source]

Return a uniformly random color.

static defaultCarColor()[source]

Default color distribution for cars.

The distribution starts with a base distribution over 9 discrete colors, then adds Gaussian HSL noise. The base distribution uses color popularity statistics from a 2012 DuPont survey.

class NoisyColorDistribution(*args, **kwargs)[source]

Bases: scenic.core.distributions.Distribution

A distribution given by HSL noise around a base color.

Parameters
  • baseColor (RGB tuple) – base color

  • hueNoise (float) – noise to add to base hue

  • satNoise (float) – noise to add to base saturation

  • lightNoise (float) – noise to add to base lightness

class ColorMutator[source]

Bases: scenic.core.object_types.Mutator

Mutator that adds Gaussian HSL noise to the color property.