Skip to content

Commit 7b72a73

Browse files
Carlos Campos FuentesCarlos Campos Fuentes
authored andcommitted
Add background color to circle progress
1 parent 2dbe11f commit 7b72a73

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@ const App = () => {
3030
* percentage (default: 80)
3131
* blankColor (default: "#eaeaea")
3232
* donutColor (default: "#43cdcf")
33+
* fillColor (default: "white")

src/CircularProgress.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ function generateArc(percentage){
3838
const CircularProgress = ({
3939
percentage = 40,
4040
blankColor = "#eaeaea",
41-
donutColor = "#43cdcf",
41+
donutColor = "#43cdcf",
42+
fillColor = "white",
4243
children
4344
}) => {
4445
return <View style={styles.base}>
@@ -48,7 +49,7 @@ const CircularProgress = ({
4849
d={`M50 50 L50 0 ${generateArc(percentage)} Z`}
4950
fill={donutColor}
5051
/>
51-
{<Circle cx="50" cy="50" r="35" fill="white"/>}
52+
{<Circle cx="50" cy="50" r="35" fill={fillColor}/>}
5253
</Svg>
5354
<View style={styles.textView}>
5455
{children}

0 commit comments

Comments
 (0)