/    Sign up×
Community /Pin to ProfileBookmark

Changing font colour?

Hello

This JS produces three different sized circles with percentages in them and I have customised them partly, but how would I change the text colour that appears, please? At the moment it is black and I wish it to be white:

[CODE]<script>
(function () {
var n, id, progress;

progress = new CircularProgress({
radius: 20
});

document.getElementById(‘myPosition’).appendChild(progress.el);

n = 0;
id = setInterval(function () {
if (n == 100) clearInterval(id);
progress.update(n++);
}, 100);
})();

(function () {
var n, id, progress;

progress = new CircularProgress({
radius: 40,
lineWidth: 2,
strokeStyle: ‘#FFAED7’,
initial: {
lineWidth: 4,
strokeStyle: ‘#ffffff’
}
});

document.getElementById(‘myPosition’).appendChild(progress.el);

n = 0;
id = setInterval(function () {
if (n == 100) clearInterval(id);
progress.update(n++);
}, 70);

})();

(function () {
var n, id, progress;

progress = new CircularProgress({

radius: 70,
strokeStyle: ‘#FFAED7’,
lineCap: ‘square’,
lineJoin: ’round’,
lineWidth: 5,
shadowBlur: 0,
shadowColor: ‘#ffffff’,
text: {
font: ‘bold 15px arial’,
shadowBlur: 0
},

initial: {

strokeStyle: ‘#ffffff’,
lineCap: ‘square’,
lineJoin: ’round’,
lineWidth: 5,
shadowBlur: 10,
shadowColor: ‘#FFB3D8’
}
});

document.getElementById(‘myPosition’).appendChild(progress.el);

n = 0;
id = setInterval(function () {
if (n == 100) clearInterval(id);
progress.update(n++);
}, 30);

})();
</script>[/CODE]

Thank you.

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@Frank62Nov 12.2014 — You might wanna try adding 'fontColor' like this:

[CODE]
text: {

font: 'bold 15px arial',
fontColor: 'white',
shadowBlur: 0
},
[/CODE]
×

Success!

Help @Blue59 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...