#!/usr/bin/env python
"""Script to display ansi colour codes to the output."""

import timbermafia.utils

codes = list(range(16, 256))

while codes:

    this_line_codes = []
    for i in range(5):
        if codes:
            this_line_codes.append(codes.pop(0))

    this_line = '| ' + timbermafia.utils.RESET
    for i in this_line_codes:
        this_line += f'{i}: '
        this_line += '\033[38;5;' + str(i) + 'm'
        this_line += 'sample text'
        this_line += timbermafia.utils.RESET + ' '
        this_line += '\033[38;5;' + str(i) + 'm'
        this_line += '\033[48;5;' + str(i) + 'm'
        this_line += '____'
        this_line += timbermafia.utils.RESET + ' | '

    print(this_line)
