# tty_try_colour

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/tty.c#L2635
- **Page:** https://libtmux.org/en/tmux/3.2a/reference/c-function-tty-c-tty_try_colour/

```c
static int tty_try_colour(struct tty *, int, const char *)
```

## Parameters

- `tty` (`struct tty *`)
- `colour` (`int`)
- `type` (`const char *`)

## Called by

- [`tty_colours_bg`](/en/tmux/3.2a/reference/c-function-tty-c-tty_colours_bg/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/tty.c#L2571)
- [`tty_colours_fg`](/en/tmux/3.2a/reference/c-function-tty-c-tty_colours_fg/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/tty.c#L2539)

## Calls

- [`colour_split_rgb`](/en/tmux/3.2a/reference/c-function-colour_split_rgb/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/tty.c#L2648)
- [`tty_putcode1`](/en/tmux/3.2a/reference/c-function-tty_putcode1/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/tty.c#L2641)
- [`tty_putcode3`](/en/tmux/3.2a/reference/c-function-tty_putcode3/) (function) [Call site](https://github.com/tmux/tmux/blob/3b929f332aafa7f1080eacc31feb11ffbb1d1841/tty.c#L2650)

## Other function references

- [`tty_term_has`](/en/tmux/3.2a/reference/c-function-tty_term_has/) (function)

## Referenced declarations

- [`COLOUR_FLAG_256`](/en/tmux/3.2a/reference/c-define-tmux-h-colour_flag_256/) (constant)
- [`COLOUR_FLAG_RGB`](/en/tmux/3.2a/reference/c-define-tmux-h-colour_flag_rgb/) (constant)
- [`tty.term`](/en/tmux/3.2a/reference/c-struct-tty-term/) (attribute)
- [`tty`](/en/tmux/3.2a/reference/c-struct-tty/) (struct)
- [`TTYC_SETAB`](/en/tmux/3.2a/reference/c-enum-tty_code_code-ttyc_setab/) (constant)
- [`TTYC_SETAF`](/en/tmux/3.2a/reference/c-enum-tty_code_code-ttyc_setaf/) (constant)
- [`TTYC_SETRGBB`](/en/tmux/3.2a/reference/c-enum-tty_code_code-ttyc_setrgbb/) (constant)
- [`TTYC_SETRGBF`](/en/tmux/3.2a/reference/c-enum-tty_code_code-ttyc_setrgbf/) (constant)
