# Ansi color codes and best practices

**URL:** <https://forum.buildkite.community/t/ansi-color-codes-and-best-practices/1209>\
**Category:** General\
**Created:** [August 26, 2020, 3:06am UTC](https://forum.buildkite.community/t/ansi-color-codes-and-best-practices/1209 "2020-08-26T03:06:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ngan](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/ngan/32/662_2.png) [@ngan](https://forum.buildkite.community/u/ngan)\
**Post date:** [August 26, 2020, 3:06am UTC](https://forum.buildkite.community/t/ansi-color-codes-and-best-practices/1209/1 "2020-08-26T03:06:35Z")

</div>

Hello, I’m trying to get nice color log output in the web ui. However, I noticed that not all colors are coming through (eg gray). Are there resources on the preferred way to maximum color and styles (bold, etc) usage for Buildkite?

For gray, I’m doing: `\e[37mHello\e[0m`.

---

<div class="post-metadata">

**Author:** ![anon85187480](https://avatars.discourse-cdn.com/v4/letter/a/90db22/32.png) [@anon85187480](https://forum.buildkite.community/u/anon85187480)\
**Post date:** [August 26, 2020, 6:26am UTC](https://forum.buildkite.community/t/ansi-color-codes-and-best-practices/1209/2 "2020-08-26T06:26:09Z")

</div>

Hi @ngan,

Are you having trouble with any other colors?

I wonder if you might be running into the fact that `\e[37m` (“white”) is the default foreground color.

If that’s the issue, `\e[38;5;251m` or similar might give you what want?

[https://buildkite.github.io/terminal-to-html/](https://buildkite.github.io/terminal-to-html/) is the library we use for ANSI rendering, but (apart from the inline image formats) we don’t get more specific in the documentation than a link to Wikipedia, I’m afraid.

---

<div class="post-metadata">

**Author:** ![ngan](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/ngan/32/662_2.png) [@ngan](https://forum.buildkite.community/u/ngan)\
**Post date:** [August 26, 2020, 7:26am UTC](https://forum.buildkite.community/t/ansi-color-codes-and-best-practices/1209/3 "2020-08-26T07:26:30Z")

</div>

All cool. I think that’s a good place for me to start looking. Thanks @anon85187480!
