I believe the latest versions of three.js at time of writing, starting with version 152, will require the texture to have its colorSpace set to SRGBColorSpace. I'm not entirely sure why but believe it relates to changes introduced via #25866.
The reason for my thinking this is that when I try the example/basic/index.html in this repository, changing ContainerText.backgroundColor from rgba(0,0,190,0.6) to rgba(55,71,79,1.0), I get this:
When I then go into dist/three-spritetext.js source and add a new line specifying the colorSpace:
// Inject canvas into sprite
if (this.material.map) this.material.map.dispose(); // gc previous texture
var texture = this.material.map = new three.Texture(canvas);
texture.minFilter = three.LinearFilter;
texture.colorSpace = three.SRGBColorSpace;
I get the expected color:
And I also get the expected color if I change the <script/> tag that pulls in three.js to pull in some version less than 152.
Hello!
I believe the latest versions of
three.js
at time of writing, starting with version 152, will require the texture to have itscolorSpace
set toSRGBColorSpace.
I'm not entirely sure why but believe it relates to changes introduced via #25866.The reason for my thinking this is that when I try the
example/basic/index.html
in this repository, changingContainerText.backgroundColor
fromrgba(0,0,190,0.6)
torgba(55,71,79,1.0)
, I get this:When I then go into
dist/three-spritetext.js
source and add a new line specifying thecolorSpace
:I get the expected color:
And I also get the expected color if I change the
<script/>
tag that pulls inthree.js
to pull in some version less than 152.