# How to set the background color of a Desmos graph

**URL:** https://cl.desmos.com/t/how-to-set-the-background-color-of-a-desmos-graph/7167
**Category:** Questions
**Created:** [August 30, 2024, 7:09pm UTC](https://cl.desmos.com/t/how-to-set-the-background-color-of-a-desmos-graph/7167 "2024-08-30T19:09:47Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![desmosnewbie](https://avatars.discourse-cdn.com/v4/letter/d/73ab20/32.png) [@desmosnewbie](https://cl.desmos.com/u/desmosnewbie)
#### Post date: [August 30, 2024, 7:09pm UTC](https://cl.desmos.com/t/how-to-set-the-background-color-of-a-desmos-graph/7167/1 "2024-08-30T19:09:47Z")

</div>

I know how to set a color variable like so:

`mycolor=rgb(12, 120, 220)`

But I would like to know how to set the _ **background** _ color of the graph to mycolor.

Please note I’m not talking about the graph/function itself or the grid, just the background color which currently is always white.

I’ve tried googling this specific question but haven’t found anything related to background color. It seems one can easily change the color of any component in Desmos except for the background color. 🫠

---

<div class="post-metadata">

### Author: ![Daniel\_Grubbs](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/daniel_grubbs/32/719_2.png) [@Daniel\_Grubbs](https://cl.desmos.com/u/Daniel_Grubbs)
#### Post date: [August 30, 2024, 7:32pm UTC](https://cl.desmos.com/t/how-to-set-the-background-color-of-a-desmos-graph/7167/2 "2024-08-30T19:32:41Z")

</div>

Welcome! The `background` sink is actually to pull graph calculator and/or sketch states from other components. There’s not a specific parameter for the background color. It’s a bit hacky since polygons will cover the grid, but you can set a polygon with your color in a hidden graph, and use that as the background for another (or more than one) graph.

> **[Examples for Forum • Activity Builder by Desmos Classroom](https://teacher.desmos.com/activitybuilder/custom/659c0a8340157b4014b5cac0#preview/03e27cd0-eb95-42ae-bc5e-d60e77d4b1d0)**
>
> by Daniel Grubbs

---

<div class="post-metadata">

### Author: ![Mike\_Gleeson](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/mike_gleeson/32/650_2.png) [@Mike\_Gleeson](https://cl.desmos.com/u/Mike_Gleeson)
#### Post date: [August 30, 2024, 9:57pm UTC](https://cl.desmos.com/t/how-to-set-the-background-color-of-a-desmos-graph/7167/3 "2024-08-30T21:57:48Z")

</div>

i think an easier way would be to simply say something like `|x|>-1` and set the custom color property to that function: [Untitled Graph | Desmos](https://www.desmos.com/calculator/nlakdrak07)

---

<div class="post-metadata">

### Author: ![desmosnewbie](https://avatars.discourse-cdn.com/v4/letter/d/73ab20/32.png) [@desmosnewbie](https://cl.desmos.com/u/desmosnewbie)
#### Post date: [August 31, 2024, 3:37am UTC](https://cl.desmos.com/t/how-to-set-the-background-color-of-a-desmos-graph/7167/4 "2024-08-31T03:37:09Z")

</div>

@Daniel_Grubbs Thanks for the tip about using a polygon. Seems to work, one just needs to know the bounds of the graph being plotted before hand.

btw is there a site one can make requests about such feature being added in future versions of Desmos?

---

<div class="post-metadata">

### Author: ![Daniel\_Grubbs](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/daniel_grubbs/32/719_2.png) [@Daniel\_Grubbs](https://cl.desmos.com/u/Daniel_Grubbs)
#### Post date: [August 31, 2024, 3:45am UTC](https://cl.desmos.com/t/how-to-set-the-background-color-of-a-desmos-graph/7167/5 "2024-08-31T03:45:02Z")

</div>

@Mike_Gleeson There’s still the issue of the inequality overlaying the graph (try it at 100% fill). I believe polygon is doing less work than an inequality which is doing evaluations over a list essentially.

@desmosnewbie You can set (and lock) the graph bounds in the wrench menu. Or you can define variables and use the `bounds:` sink in the CL. I updated the above example to include CL defined bounds.

---

<div class="post-metadata">

### Author: ![Mike\_Gleeson](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/mike_gleeson/32/650_2.png) [@Mike\_Gleeson](https://cl.desmos.com/u/Mike_Gleeson)
#### Post date: [August 31, 2024, 1:36pm UTC](https://cl.desmos.com/t/how-to-set-the-background-color-of-a-desmos-graph/7167/6 "2024-08-31T13:36:54Z")

</div>

Horses for courses but I think using `|x|>-1` or similar is much more compact and extensible.

---

<div class="post-metadata">

### Author: ![jcponcemath](https://avatars.discourse-cdn.com/v4/letter/j/bcef8e/32.png) [@jcponcemath](https://cl.desmos.com/u/jcponcemath)
#### Post date: [September 2, 2024, 8:54pm UTC](https://cl.desmos.com/t/how-to-set-the-background-color-of-a-desmos-graph/7167/7 "2024-09-02T20:54:51Z")

</div>

I was using polygon() at the beginning, but now I always use |x|\>=0

---

<div class="post-metadata">

### Author: ![Daniel\_Grubbs](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/daniel_grubbs/32/719_2.png) [@Daniel\_Grubbs](https://cl.desmos.com/u/Daniel_Grubbs)
#### Post date: [June 21, 2026, 3:26pm UTC](https://cl.desmos.com/t/how-to-set-the-background-color-of-a-desmos-graph/7167/8 "2026-06-21T15:26:00Z")

</div>

@Mike_Gleeson Coming back to this after something popping up in my notifications. Generally it’s not going to matter too much, but if there are concerns about performance, polygons are less of a strain than inequalities.  
Inequality:

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/desmos/original/2X/2/2558562a78714ca7f492383a7c47e7538ac57944.png)

Polygon:

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/desmos/original/2X/c/c610fbd863de864d41e0ce95c95712188951fa0f.png)

---

<div class="post-metadata">

### Author: ![Mike\_Gleeson](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/mike_gleeson/32/650_2.png) [@Mike\_Gleeson](https://cl.desmos.com/u/Mike_Gleeson)
#### Post date: [June 22, 2026, 1:39pm UTC](https://cl.desmos.com/t/how-to-set-the-background-color-of-a-desmos-graph/7167/9 "2026-06-22T13:39:45Z")

</div>

Interesting. But I think it depends on a great number of variables that have nothing to do with the method itself. For example, here’s what I got when I tried it:

**Inequality:**

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/desmos/original/2X/d/de9312ed9973f925e18a01cbe20e5fb2054d794f.png)

**Polygon:**

 ![polyShot](https://canada1.discourse-cdn.com/flex031/uploads/desmos/original/2X/9/9f43583272aae16021763bb77f680e0142b3f5ae.jpeg)

More pertinently though is what happens when the graphs are rendered in an Actiivty. Here’s Chrome Dev Tools showing the Waterfall under Network Activity:

**Inequality:**

 ![inequality](https://canada1.discourse-cdn.com/flex031/uploads/desmos/original/2X/b/b21f60a62fa9d28f229ad4b7fa980079650a10d9.jpeg)

**Polygon:**

 ![polygon](https://canada1.discourse-cdn.com/flex031/uploads/desmos/original/2X/0/0c2b00c58017836c82f8c9bf4e158e1507ff763c.jpeg)

This happened consistently over many iterations. I think what’s likely happening is that becauase the background polygon method paints two graphs, it slows things down.

At any rate, having two components to do the job of one doesn’t seem great in general, but especially since the dummy graph’s background acts as a pseudo-element and can’t be inherited to other graphs should the need arise.

---

<div class="post-metadata">

### Author: ![Daniel\_Grubbs](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/daniel_grubbs/32/719_2.png) [@Daniel\_Grubbs](https://cl.desmos.com/u/Daniel_Grubbs)
#### Post date: [June 22, 2026, 1:59pm UTC](https://cl.desmos.com/t/how-to-set-the-background-color-of-a-desmos-graph/7167/10 "2026-06-22T13:59:38Z")

</div>

Thanks for diving a little deeper into that!
