# Question about color between object and background

**URL:** <https://discourse.threejs.org/t/question-about-color-between-object-and-background/11503>\
**Category:** Questions\
**Tags:** materials\
**Created:** [December 10, 2019, 6:34am UTC](https://discourse.threejs.org/t/question-about-color-between-object-and-background/11503 "2019-12-10T06:34:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ozymandiaz](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/ozymandiaz/32/8356_2.png) [@Ozymandiaz](https://discourse.threejs.org/u/Ozymandiaz)\
**Post date:** [December 10, 2019, 6:34am UTC](https://discourse.threejs.org/t/question-about-color-between-object-and-background/11503/1 "2019-12-10T06:34:45Z")

</div>

hello, i try to make a simple puzzle game. but i have some problem.

i make some box and set color same to background color.

but it is not matched on result.

please see this screenshot.  
 ![image](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/2X/b/b6bbe255a2956b3911bb67d2047e93d3353503da.png)

and here is code.  
 ![image](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/2X/1/1fb70cf38c8162f370628fae4bdf1dd4b9e614b0.png)

i just create two light(directional, hemisphere) and no ambient light.

as i know MeshBasicMaterial not affect by light, so why show different color when i set a same color?

when i set a color to white(0xffffff) or black(0x000000) it works what i want.

i’m using r110 version.

best regards.

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [December 10, 2019, 12:50pm UTC](https://discourse.threejs.org/t/question-about-color-between-object-and-background/11503/2 "2019-12-10T12:50:37Z")

</div>

I’m afraid I’m not able to reproduce with the following live example:

[https://jsfiddle.net/73zmbogj/](https://jsfiddle.net/73zmbogj/)

Can you please try to update the live example in order to demonstrate the issue?

---

<div class="post-metadata">

**Author:** ![Ozymandiaz](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/ozymandiaz/32/8356_2.png) [@Ozymandiaz](https://discourse.threejs.org/u/Ozymandiaz)\
**Post date:** [December 10, 2019, 4:03pm UTC](https://discourse.threejs.org/t/question-about-color-between-object-and-background/11503/3 "2019-12-10T16:03:38Z")

</div>

first of all, i found what cause problem.

if WebGLRenderer’s gammaOutput is true, it show a color problem.

if gammaOutput are false, it works fine what i want.

what i understand after read document, if gammaOutput is true, all type of materials are affect the texture and color.

so if I want the background color and the color of the object to be the same, should the gammaOutput option be true?

in my previous practice, GLTF models are too dark when gammaOutput are false.

[https://jsfiddle.net/r9kc5Lvq/4/](https://jsfiddle.net/r9kc5Lvq/4/)

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [December 10, 2019, 4:36pm UTC](https://discourse.threejs.org/t/question-about-color-between-object-and-background/11503/4 "2019-12-10T16:36:41Z")

</div>

The problem is that `scene.background` is only affected by `WebGLRenderer.gammaOutput` if it is a texture. This is a known issue and tracked by [https://github.com/mrdoob/three.js/issues/11337](https://github.com/mrdoob/three.js/issues/11337). The goal is to provide an easier-to use color management in `three.js`. For now, you can fix the issue like so:

```auto
scene.background.convertLinearToGamma( 2 );

```

This will perform the missing color space conversion.

[https://jsfiddle.net/j6w8xcvg/](https://jsfiddle.net/j6w8xcvg/)

---

<div class="post-metadata">

**Author:** ![Ozymandiaz](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/ozymandiaz/32/8356_2.png) [@Ozymandiaz](https://discourse.threejs.org/u/Ozymandiaz)\
**Post date:** [December 11, 2019, 5:08am UTC](https://discourse.threejs.org/t/question-about-color-between-object-and-background/11503/5 "2019-12-11T05:08:03Z")

</div>

thanks!

problem is solved.
