This forum is now read-only. Please use our new forums at discuss.codecademy.com.

Animate Your Name Forum

View Course

461 points
547ab5d87c82ca03750075ac_226250343
Submitted by
Rian O'Brian
about 2 years ago

The color doesn't change, comes up white or black

Why can't I change the color?


0 votes

permalink

Hi Rian Webster,

If you can't get the color to change then you probably aren't using the correct code. If you copy/paste your work in here then I'll help you find the problem.

3698 points
55df2afa95e3787b9200005e_359368177
Submitted by
Judy
about 2 years ago

1 Comment

547ab5d87c82ca03750075ac_226250343 Rian O'Brian about 2 years ago

Sorry for the late reply, I'll paste it now:


0 votes

permalink

I put it on my PC and deleted it, I had two problems:
Colour doesn't work, displays as white in my own website. (However, I can see the colours on Codecademy's code results.
When I try to have multiple scripts, it doesn't work, only one displays in colour. (Could be all displaying just white, or it just displays one.)

461 points
547ab5d87c82ca03750075ac_226250343
Submitted by
Rian O'Brian
about 2 years ago

1 Comment

55df2afa95e3787b9200005e_359368177 Judy about 2 years ago

"Displays as white" means that you didn't see any bubbles? Black is the default colour set in bubbles.js -- if no other colours are assigned via the letterColors variable then black is what you get. If you were going to go at this again I would suggest looking closely at that variable and the order that your .js files are loaded.


0 votes

permalink

Ok, so I found the code:

var red = [342, 100, 97];
var blue = [198, 78, 60];
var yellow = [58, 95, 97];
var green = [147, 55, 97]
var lightblue = [207, 14, 97];

var myName = "The Plums";
letterColors = [green, blue, yellow, red, lightblue]

drawName(myName, letterColors);
bounceBubbles();

461 points
547ab5d87c82ca03750075ac_226250343
Submitted by
Rian O'Brian
about 2 years ago

3 Comments

55df2afa95e3787b9200005e_359368177 Judy about 2 years ago

That looks fine. What does the HTML file look like?

547ab5d87c82ca03750075ac_226250343 Rian O'Brian about 2 years ago

Referencing the js file here

55df2afa95e3787b9200005e_359368177 Judy about 2 years ago

Hi Rian, when you say "Referencing the js file", do you mean a file with just that bit of js code that you posted above? Do you have links to jQuery, alphabet.js, bubbles.js, and have you included a canvas element?