# tty_try_colour

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tty.c#L3027
- **Page:** https://libtmux.org/en/tmux/3.7c/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.7c/reference/c-function-tty-c-tty_colours_bg/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tty.c#L2955)
- [`tty_colours_fg`](/en/tmux/3.7c/reference/c-function-tty-c-tty_colours_fg/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tty.c#L2923)

## Calls

- [`colour_split_rgb`](/en/tmux/3.7c/reference/c-function-colour_split_rgb/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tty.c#L3040)
- [`tty_putcode_i`](/en/tmux/3.7c/reference/c-function-tty_putcode_i/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tty.c#L3033)
- [`tty_putcode_iii`](/en/tmux/3.7c/reference/c-function-tty_putcode_iii/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/tty.c#L3042)

## Other function references

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

## Referenced declarations

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