# Go.set("#label", "color",) function may be not working in html5?

**URL:** <https://forum.defold.com/t/go-set-label-color-function-may-be-not-working-in-html5/67079>\
**Category:** Bugs\
**Created:** [December 23, 2020, 5:18am UTC](https://forum.defold.com/t/go-set-label-color-function-may-be-not-working-in-html5/67079 "2020-12-23T05:18:50Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![tiki](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/tiki/32/22898_2.png) [@tiki](https://forum.defold.com/u/tiki)\
**Post date:** [December 23, 2020, 5:18am UTC](https://forum.defold.com/t/go-set-label-color-function-may-be-not-working-in-html5/67079/1 "2020-12-23T05:18:51Z")

</div>

**To Reproduce (REQUIRED)**  
Hello

I want to control alpha of label attached gameobject.  
But this code

```lua
go.set("#label", "color", vmath.vector4(1, 1, 1, 0))

```

html5(chrome)

 ![image3](https://forum-defold.b-cdn.net/uploads/default/original/3X/a/6/a6c19b86b638a8a04fdaae546e26026cc992aff4.png)  
windows 10  
 ![image4](https://forum-defold.b-cdn.net/uploads/default/original/3X/1/1/11b216e02b0d089465276518dcb21e6fa432f477.png)  
is not working in html5 ,but working on windows.  
on the other hand this code

```lua
go.animate("#label", "color", go.PLAYBACK_LOOP_PINGPONG, 
vmath.vector4(1,1,1,0), go.EASING_OUTSINE, 2)

```

is working html5 and windows.  
But label component can’t set start alpha.  
I want to tween alpha of label from 0 to 1 on html5.  
This is bug?  
or  
my usage is something wrong?  
**Expected behaviour (REQUIRED)**  
Control alpha of label on html5.

**Defold version (REQUIRED):**

- Version [1.2.177]

**Platforms (REQUIRED):**

- Platforms: [Windows, HTML5]
- OS: [Windows 10,]
- Device: [desktop]

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [December 23, 2020, 6:54am UTC](https://forum.defold.com/t/go-set-label-color-function-may-be-not-working-in-html5/67079/2 "2020-12-23T06:54:18Z")

</div>

> [@tiki](#):
>
> is not working in html5 ,but working on windows

Are you sure? There shouldn’t be a difference between the two platforms. Does nothing happen in html5?

---

<div class="post-metadata">

**Author:** ![tiki](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/tiki/32/22898_2.png) [@tiki](https://forum.defold.com/u/tiki)\
**Post date:** [December 23, 2020, 8:05am UTC](https://forum.defold.com/t/go-set-label-color-function-may-be-not-working-in-html5/67079/3 "2020-12-23T08:05:00Z")

</div>

Yes.  
I try again this code

```lua
go.set("#label", "color", vmath.vector4(0, 1, 1, 0.5))

```

html5(chrome)

 ![image1](https://forum-defold.b-cdn.net/uploads/default/original/3X/9/7/9731df113e8110e62588253b696c434e0db416d2.png)  
windows 10  
 ![image2](https://forum-defold.b-cdn.net/uploads/default/original/3X/4/8/48d40d6301b7e02f51ec889527fcd007901edb7a.png)  
RGB is working,but only alpha of label may be not working on html5

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [December 23, 2020, 8:50am UTC](https://forum.defold.com/t/go-set-label-color-function-may-be-not-working-in-html5/67079/4 "2020-12-23T08:50:13Z")

</div>

Thanks. It could be something in the font shader.

---

<div class="post-metadata">

**Author:** ![tiki](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/tiki/32/22898_2.png) [@tiki](https://forum.defold.com/u/tiki)\
**Post date:** [December 23, 2020, 9:11am UTC](https://forum.defold.com/t/go-set-label-color-function-may-be-not-working-in-html5/67079/5 "2020-12-23T09:11:55Z")

</div>

Thanks.

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [December 23, 2020, 9:39am UTC](https://forum.defold.com/t/go-set-label-color-function-may-be-not-working-in-html5/67079/6 "2020-12-23T09:39:42Z")

</div>

> [@britzl](#):
>
> It could be something in the font shader.

Created issue on GH: [Label alpha not working properly in HTML5 builds · Issue #5428 · defold/defold · GitHub](https://github.com/defold/defold/issues/5428)

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [December 23, 2020, 9:48am UTC](https://forum.defold.com/t/go-set-label-color-function-may-be-not-working-in-html5/67079/7 "2020-12-23T09:48:05Z")

</div>

@tiki thanks for the report!  
If you wouldn’t mind, please attach a small repro case to the issue. It’ll make it easier/faster for the developer that takes a look at the issue.

---

<div class="post-metadata">

**Author:** ![tiki](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/tiki/32/22898_2.png) [@tiki](https://forum.defold.com/u/tiki)\
**Post date:** [December 23, 2020, 10:05am UTC](https://forum.defold.com/t/go-set-label-color-function-may-be-not-working-in-html5/67079/8 "2020-12-23T10:05:55Z")

</div>

Attached repro case to the issue on GH : [https://github.com/defold/defold/issues/5428](https://github.com/defold/defold/issues/5428)

---

<div class="post-metadata">

**Author:** ![Pkeod](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/pkeod/32/606_2.png) [@Pkeod](https://forum.defold.com/u/Pkeod)\
**Post date:** [December 23, 2020, 11:17am UTC](https://forum.defold.com/t/go-set-label-color-function-may-be-not-working-in-html5/67079/9 "2020-12-23T11:17:01Z")

</div>

HTML5 target is more picky about ints vs floats in its shaders, generally best to stick with floats. Even when you want to zero something out so 0. or 0.0 for clarity. That would mean floats for all values too. Check the console to see if there is any warning about that.

---

<div class="post-metadata">

**Author:** ![tiki](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/tiki/32/22898_2.png) [@tiki](https://forum.defold.com/u/tiki)\
**Post date:** [December 24, 2020, 1:54am UTC](https://forum.defold.com/t/go-set-label-color-function-may-be-not-working-in-html5/67079/10 "2020-12-24T01:54:21Z")

</div>

@Pkeod  
Thank you for your help.  
I confirmed chrome console

 ![image5](https://forum-defold.b-cdn.net/uploads/default/original/3X/0/1/0170b21ea83c43f3af1f9bb456d0cf20d55db6af.png)  
I didn’t have discover warning about float values.  
But because of using gui attached label can control alpha of label on the editor,  
so my problem may be solved.  
I will return my game development.  
Actually,this is my first time experience to question in English.

---

<div class="post-metadata">

**Author:** ![enotofil](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/enotofil/32/27432_2.png) [@enotofil](https://forum.defold.com/u/enotofil)\
**Post date:** [August 13, 2021, 7:20am UTC](https://forum.defold.com/t/go-set-label-color-function-may-be-not-working-in-html5/67079/11 "2021-08-13T07:20:42Z")

</div>

Got same problem on Defold 1.2.185, Windows 10, Chrome 92, Firefox 88

 ![problemo](https://forum-defold.b-cdn.net/uploads/default/original/3X/9/c/9cf3186498eb446f5f22f6bce1a62d57ee4f3d56.png)
