ziggy42 / kolor

A library to print colored strings, with Kotlin.
Apache License 2.0
78 stars 7 forks source link

Implement color extension function for String #13

Closed tonsV2 closed 2 years ago

tonsV2 commented 4 years ago

Assuming you accept this pull request I would suggest you take it one step further and use this color extension function to implement all the other extension functions.

fun String.black() = this.color(BLACK)

Another thing, one of the things which makes Kotlin beautiful is that it's less verbose than Java. Instead of System.out.println we simply write println. With that in mind I'll encourage importing "com.andreapivetta.kolor.Color.*" so all colors aren't prefixed with "Color.".

Thanks for a nice library.

ziggy42 commented 4 years ago

Hey @tonsV2 , thanks for your contribution. I think it would make sense to use fun String.black() = this.color(BLACK), you can go ahead and add it to this PR.

For your second point, I'll think about it a bit more.

tonsV2 commented 4 years ago

Hi @ziggy42, I've updated my commit.