---
title: environment
framework: swiftui
role: symbol
role_heading: Instance Property
path: swiftui/graphicscontext/environment
---

# environment

The environment associated with the graphics context.

## Declaration

```swift
var environment: EnvironmentValues { get set }
```

## Discussion

Discussion SwiftUI initially sets this to the environment of the context’s enclosing view. The context uses values like display resolution and the color scheme from the environment to resolve types like Image and Color. You can also access values stored in the environment for your own purposes.
