Not sure what i’m doing wrong, text isn’t colouring correctly

Project link: draft

1-sentence description of the issue: text isn’t changing colour

What do you want your code to do? the text to turn purple

What is the code currently doing? keeping it black

Screenshots:


7 Likes

That’s just not how color works in hs. Check out this projects code, the one on the left is what you were trying to and the one on the right is an even better way to do it.

9 Likes

If you really want to use a string, you can use any valid CSS color and store that on the variable. Examples:

Red: red
Purple: #aa00aa
Gold: rgb(255,190,0)
Green: hsl(100deg,80%,50%)

Otherwise, you need to use the HSB or RGB block

9 Likes

That’s awesome!

8 Likes

Unfortunately, that won’t work. You need 3 different variables if you are doing hsb or rgb. This topic might help, though.

5 Likes

(nop, no need, see ae post :))

6 Likes

You need to do one of the following for this to work, most of which Awesome_E has mentioned.

  • Colour = 1 (this returns a default color purple)
  • Colour = hsl(275deg,100%,100%)
  • Colour = rgb(148,0,255)
  • Colour = purple
  • Colour = #9400ff

There’s also

  • Colour = rgba(148,0,255,0.5), which returns translucent purple.

You can’t do any of these prior to update 3.50.0 (or maybe prior to player 2.0.x, I forgot which)…

6 Likes

I would personally use the hexadecimal format, as that uses the least amount of characters (7), and also the same amount for every color.

6 Likes

Well, you could use strings like ae and Crosbyman said but I’d suggest using the post I’m replying to until you get even more of a hand of strings

4 Likes

I think you should just use a text box and use the Set Color block.

5 Likes

Try using the game variable instead. And try using HSB instead (make 3 variables since it’s HSB)

5 Likes

It’s possible that you could have. I just know that HSB didn’t work previously (or now) through a variable set to that string so I never tried these formats before 2.0.x

6 Likes

doesn’t seem to work for me (either hsb and hsl)
can anyone help?

2 Likes

Try

hsl(275deg,100%,50%)

in hsl, 50% lightness = 100% brightness in HSB.

2 Likes

Use a + ) to do it.

1 Like

refer to that post in ytaco :))

1 Like

@FearlessPhoenix clive this now please

1 Like