---
title: "background"
description: "Apply a background color to the element this modifier is attached to. This will cause the element
to paint the specified [Color] as its background, choosing [day] or [night] depending on the
device configuration, which will fill the bounds of the element."
type: "function"
---

<div class='type'>Function</div>


<a id='references'></a>
<div class='sourceset sourceset-android'>Android</div>


```kotlin
public fun GlanceModifier.background(day: Color, night: Color): GlanceModifier
```


Apply a background color to the element this modifier is attached to. This will cause the element
to paint the specified `Color` as its background, choosing `day` or `night` depending on the
device configuration, which will fill the bounds of the element.



