From 7953516f7a8f588b26c1eb6e83523a30f8b2111f Mon Sep 17 00:00:00 2001 From: Simon MacDonald Date: Sun, 4 Feb 2018 20:09:41 -0500 Subject: [PATCH] Issue #25: Support font color --- coffee/react-countdown-clock.coffee | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/coffee/react-countdown-clock.coffee b/coffee/react-countdown-clock.coffee index 54b6f23..b21d872 100644 --- a/coffee/react-countdown-clock.coffee +++ b/coffee/react-countdown-clock.coffee @@ -172,9 +172,13 @@ ReactCountdownClock = CreateReactClass # Timer @_timer.globalAlpha = @props.alpha - @_timer.fillStyle = @props.color + if @props.fontColor + @_timer.fillStyle = @props.fontColor + else + @_timer.fillStyle = @props.color @_timer.font = "bold #{@_fontSize(formattedTime)} #{@props.font}" @_timer.fillText text, @_radius, @_radius + @_timer.fillStyle = @props.color @_timer.beginPath() @_timer.arc @_radius, @_radius, @_radius, Math.PI * 1.5, Math.PI * percent, false @_timer.arc @_radius, @_radius, @_innerRadius, Math.PI * percent, Math.PI * 1.5, true @@ -196,6 +200,7 @@ ReactCountdownClock.propTypes = weight: PropTypes.number color: PropTypes.string fontSize: PropTypes.string + fontColor: PropTypes.string font: PropTypes.string alpha: PropTypes.number timeFormat: PropTypes.string