I know what you finally want. And there are a few possibilities to do that.
Some of them are already mentioned:
- text frame options (with object style)
- character style (with underline)
You can also use:
- paragraph rule (in paragraph style)
- paragraph shading (in paragraph style)
But we do not know what are your requirements. And that's why we cannot say which method is the best for you.
- Should the text frame always have the same size?
- Should the text always changing it's contents?
- Should the "colored area" always follows the changed text?
- Are there always "one liner texts"?
- and so on …
Here is an example of paragraph shading (color "follows" the text) :

live changing after text was edited:

Please answer my previous questions - so that we can really help you.