# Falling back to 256-colour palette

**URL:** <https://discuss.kakoune.com/t/falling-back-to-256-colour-palette/1964>\
**Category:** Complaints & Improvements\
**Created:** [December 16, 2021, 3:13pm UTC](https://discuss.kakoune.com/t/falling-back-to-256-colour-palette/1964 "2021-12-16T15:13:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChrisW](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/chrisw/32/1037_2.png) [@ChrisW](https://discuss.kakoune.com/u/ChrisW)\
**Post date:** [December 16, 2021, 3:13pm UTC](https://discuss.kakoune.com/t/falling-back-to-256-colour-palette/1964/1 "2021-12-16T15:13:30Z")

</div>

When ssh-ing from a friend or family-member’s machine instead of my own, I often find myself using older terminals which support the 256-colour xterm palette but not 24-bit RGB colour. (Rxvt-unicode and the MacOS built-in Terminal.app are examples that spring to mind.)

It’s probably a bit niche for upstream — hopefully non-RGB terminals are a vanishing breed! — but in case anyone else finds themselves in a similar situation, I just tidied up a local patch which adds an option to transparently map RGB colours to an appropriate entry in the 256-colour palette so you don’t have to drop right back to a 16-colour scheme.

[https://github.com/arachsys/kakoune/commit/use-palette](https://github.com/arachsys/kakoune/commit/use-palette)

It’s only doing simple RGB quantisation to the 6x6x6 cube, with a special case for the 24 scales of grey, but it works pretty well. Here’s kaleidoscope-light 24-bit on the left vs 256-colour on the right:

 ![Screenshot 2021-12-16 at 17.46.35](https://discuss.kakoune.com/uploads/default/original/2X/7/782fc0e52dc23e8a94389339f2a22ecade584a33.png)

and here’s base16 24-bit on the left vs 256-colour on the right:

 ![Screenshot 2021-12-16 at 17.47.24](https://discuss.kakoune.com/uploads/default/original/2X/3/3be0aeccf038c4cb3c3add283d4d1342eedc541b.png)

You can see colours aren’t quite identical but aren’t a bad match either: certainly much nicer than being restricted to 16 colours.
