How to draw Rounded corner rectangle as per given image sample?

can you please let me know how to create button like given image. when i click it will fill the color on selected item. here is the sample what i want. i am new in juce. Please share code if you have for great help.
button

Look here > https://github.com/WeAreROLI/JUCE/blob/master/modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V4.cpp#L284-L329

i got the function from the class. But how to set in my class with which component? Actually i am newbie in Juce sir so Please help me

if you are not able to extrapolate the Path generation and stroke/filling in that function i posted and adapt it to make it work in your own Component paint method, you’d better start off with something simpler then…

okay i will try and start with basic draw function. If you have any sample to learn it then let me know. Actually i dont know the c++. I am learning juce and try to desing UI for mobile app

Sir i have tried using the given method but able to whole button rectangle. I want to draw half portion filled and half without fill color. can you please help me for this

Take a look at the graphics tutorials: https://docs.juce.com/master/tutorial_point_line_rectangle.html

And then look at the graphics class reference:
https://docs.juce.com/master/classGraphics.html

Within that you will probably need a drawRoundedRectangle, fillRoundedRectangle and a fillRectangle to make that shape.

Also, you should probably learn some basic c++ before trying JUCE.