StyleRule.gamma constructor Null safety

StyleRule.gamma(
  1. double gamma
)

(a floating point value between 0.01 and 10.0, where 1.0 applies no correction) indicates the amount of gamma correction to apply to the element. Gamma corrections modify the lightness of colors in a non-linear fashion, while not affecting white or black values. Gamma correction is typically used to modify the contrast of multiple elements. For example, you can modify the gamma to increase or decrease the contrast between the edges and interiors of elements.

Note: This option adjusts the lightness relative to the default Google style, using a gamma curve. If Google makes any changes to the base map style, the changes affect your map's features styled with gamma. It's better to use the absolute color styler if you can.

Implementation

StyleRule.gamma(double gamma)
    : assert(
        gamma >= 0.01 && gamma <= 10.0,
        "gamma argument must be in range 0.01 to 10.0",
      ),
      _key = "gamma",
      _value = gamma.toString();