Create a special slider? SOLVED

Hello guys. I need some ideas how to implement something. I’m trying to create a slider like you see in the photo. That red line is moving from 0 to 100 and back. If the player hits space while the red line is not in the dark gray area something happens and if it’s in something else happens. Do you have any ideas how to implement that? I was thinking to some slider but I’m not sure how to put that dark gray and how can I know if the line is in the dark area. I know how to get the value of the slider but I’m not sure if I can get the size of the dark area.
Please Help

There is a slider UI component under canvas UI. In that component is a float value you can use to do what you stated.

That’s what I said. “I know how to get the value”. My problem is not with the value. Is with the dark gray part of the slider. As you can see there the dark value is like 20% of the slider. How can I know if my value is between those boundaries.

Actually I think I have found the solution. Using the size of the slider