# nodesnim/environment

Dark Mode

Search:
Group by:

# Imports

core/color

# Types

    EnvironmentObj = object
      delay*: int                  ## window delay.
      color*: ColorRef             ## background environment color.
      brightness*: float

    EnvironmentRef = ref EnvironmentObj

# Procs

    proc newEnvironment(color: ColorRef; brightness: float): EnvironmentRef {...}{.raises: [],
        tags: [].}

  Creates a new EnvironmentRef object.

  Arguments:

  - `color`: ColorRef object for background environment color.
  - `brightness` - window brightness with value in range `0..1`

    proc newEnvironment(): EnvironmentRef {...}{.inline, raises: [], tags: [].}

  Creates a new EnvironmentRef object.

    proc setBackgroundColor(env: EnvironmentRef; color: ColorRef) {...}{.raises: [], tags: [].}

  Changes background environment color.

  Arguments:

  - `color`: ColorRef object.

    proc setBackgroundColor(env: EnvironmentRef; color: uint32) {...}{.raises: [], tags: [].}

  Changes background environment color.

  Arguments:

  - `color`: uint32 color, e.g.: 0xFF64FF

    proc setBrightness(env: EnvironmentRef; brightness: float) {...}{.raises: [], tags: [].}

  Changes window brightness.

  Arguments:

  - `brightness` - window brightness with value in range `0..1`

    proc setDelay(env: EnvironmentRef; delay: int) {...}{.raises: [], tags: [].}

  Changes window delay.

  Arguments:

  - `delay`: should be `1000 div FPS`, e.g.: `1000 div 60 for 60` frames per second.