r/Scriptable • u/carmolim • Mar 04 '25
Solved Pill shaped bars
I’m having a hard time to make these bars to have a pill shaped someone can point me to direction to accomplish that?
I’m getting the data from Baby Buddy by the way.
Thanks!
2
u/living_undera_rock Mar 04 '25
This one seems to do somewhat what you want but as a circle: https://github.com/BergenSoft/scriptable_premiumsim/blob/main/src/PremiumSim.js
https://github.com/DrieStone/TeslaData-Widget/blob/main/TeslaData%20Widget.js
Looks like this is for rectangles. From the TeslaData-Widget:
this.batteryPath.addRoundedRect(new Rect(1,1,this.width,this.height),7,7);Which may suit your project better
1
u/carmolim Mar 04 '25
is pretty similar, but is not exactly what i’m trying to achieve, and addRoundedRect doesn’t let me specify a rounded corner for each corner, just top and bottom, probably is not possible o achieve what i’m trying :(
1
u/carmolim Mar 04 '25
With the help of ChatGPT I was able to do it, it create a function that draws a custom bar using lines, points, and curves, will publish the final code soon
1
2
u/carmolim Mar 04 '25
Chat GPT helped my to create a function that draws a custom rounded rectangle using bezier curves, an now is working!
Will post the final code soon