# Question about colorize and methods

**URL:** <https://forum.crystal-lang.org/t/question-about-colorize-and-methods/4177>\
**Category:** Help & Support\
**Created:** [December 22, 2021, 4:47pm UTC](https://forum.crystal-lang.org/t/question-about-colorize-and-methods/4177 "2021-12-22T16:47:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fulgurance](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/fulgurance/32/1463_2.png) [@Fulgurance](https://forum.crystal-lang.org/u/Fulgurance)\
**Post date:** [December 22, 2021, 4:47pm UTC](https://forum.crystal-lang.org/t/question-about-colorize-and-methods/4177/1 "2021-12-22T16:47:38Z")

</div>

Hello, actually I’m working in the output design of this part of my function:

```auto
puts "#{ISM::Default::Option::SoftwareInstall::InstallQuestion.colorize.mode(:underline)}" + 
                                "[" + "#{ISM::Default::Option::SoftwareInstall::YesReplyOption.colorize(:green)}" + 
                                "/" + "#{ISM::Default::Option::SoftwareInstall::NoReplyOption.colorize(:red)}" + "]"

                        loop do
                            userInput = gets
                        
                            if userInput == ISM::Default::Option::SoftwareInstall::YesReplyOption
                                userAgreement = true
                                break
                            end
                            if userInput == ISM::Default::Option::SoftwareInstall::NoReplyOption
                                break
                            end
                        end

```

First question, can I change ONLY the color of the underline ?

My second question is, just after my String before the loop, I have a gets method. How can I do to have my cursor just after my text, and not in a newline after

---

<div class="post-metadata">

**Author:** ![straight-shoota](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/straight-shoota/32/36_2.png) [@straight-shoota](https://forum.crystal-lang.org/u/straight-shoota)\
**Post date:** [December 22, 2021, 5:06pm UTC](https://forum.crystal-lang.org/t/question-about-colorize-and-methods/4177/2 "2021-12-22T17:06:31Z")

</div>

> [@Fulgurance](#):
>
> can I change ONLY the color of the underline ?

AFAIK terminal coloring only supports foreground and background color and the underline is always the foreground color.

> [@Fulgurance](#):
>
> How can I do to have my cursor just after my text, and not in a newline after

This is unfortunately not trivial to achieve. I’d recommend using a dedicated library for terminal UI such as readline or curses if you want this.

---

<div class="post-metadata">

**Author:** ![Fulgurance](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/fulgurance/32/1463_2.png) [@Fulgurance](https://forum.crystal-lang.org/u/Fulgurance)\
**Post date:** [December 22, 2021, 10:36pm UTC](https://forum.crystal-lang.org/t/question-about-colorize-and-methods/4177/3 "2021-12-22T22:36:51Z")

</div>

Oh sad … okay thanks you

---

<div class="post-metadata">

**Author:** ![jgaskins](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/jgaskins/32/2449_2.png) [@jgaskins](https://forum.crystal-lang.org/u/jgaskins)\
**Post date:** [December 24, 2021, 8:53am UTC](https://forum.crystal-lang.org/t/question-about-colorize-and-methods/4177/4 "2021-12-24T08:53:51Z")

</div>

> [@Fulgurance](#):
>
> My second question is, just after my String before the loop, I have a gets method. How can I do to have my cursor just after my text, and not in a newline after

If you mean something like this:

```plaintext
Install? [Y/n] ▋

```

instead of

```plaintext
Install? [Y/n]
▋

```

Then you can achieve that by changing `puts` to `print`. `puts` adds an implicit newline at the end of the output, but `print` does not.

---

<div class="post-metadata">

**Author:** ![Fulgurance](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/fulgurance/32/1463_2.png) [@Fulgurance](https://forum.crystal-lang.org/u/Fulgurance)\
**Post date:** [December 24, 2021, 9:26am UTC](https://forum.crystal-lang.org/t/question-about-colorize-and-methods/4177/5 "2021-12-24T09:26:07Z")

</div>

Yes it’s what I mean, I will try that, thanks you

It’s perfect, thanks you very much.

My mistake is I was thinking the problem came from the gets command. I don’t know why I was thinking that
