🌈 Generate color palettes based on Neovim colorschemes.

Overview

Iris

Iris is a Neovim plugin that generates a normalized color palette based on your colorscheme. It is named for the goddess Iris of Greek mythology, personification of the rainbow.

Table of Contents

Why?

My development environment consists of three primary tools: Neovim, tmux, and kitty. I like to try and keep the color settings of these tools synchronized against a single palette. This task, at the very least, means finding pre-built matching configuration files and more often means writing some of these files myself. This is a boring, error-prone process, which makes it a good candidate for automation. So here we are.

Overview

Iris gives you access to a Lua table representing a color palette with a set of known keys each time a colorscheme is loaded.

By specifying a series of callback functions, you can leverage this palette to automatically update the colors of Neovim as well as external programs. For example, I have callbacks in place to:

  • Customize certain Neovim highlight groups
  • Set my galaxyline colors
  • Set my tmux colors using the tmux CLI
  • Set my kitty colors using kitty’s remote control facility

Orthogonality

A tenet of lightline.vim which I admire is the concept of plugin orthogonality. lightline.vim describes it thusly:

The plugin does not rely on the implementation of other plugins. Such plugin crossing settings should be configured by users.

Iris extends this to external tools and, as such, includes no built-in color-changing functionality. Such behavior is beyond the scope and intent of this plugin, and is left to the end user to implement.

The Palette

An Iris palette is composed of a set of core colors based on the base16 architecture as well as some convenient aliases and a few specialized colors.

Conjuring

There are a few methods with which an Iris palette is brought forth, listed here in order of precedence:

  1. If you have created and specified a custom palette named the same as your colorscheme, Iris will use this data, filling in the gaps where necessary. A custom palette must define at minimum the sixteen core colors. You can see my custom Tokyo Night palette as an example.
  2. If the nvim-base16 plugin is available and you are using a base16-* colorscheme, Iris will use the base16 colors defined by the plugin.
  3. In every other scenario, the palette is derived from existing Neovim highlight groups. This usually works pretty well and makes Iris a hands-off solution in most cases.

Colors

An Iris palette contains a few groups of colors, described hereafter.

Base Colors

These are the core base16 colors, as defined by the base16 spec.

Aliases

These are aliases for base colors that make the palette table easier to work with. Some examples:

  • green maps to base0B
  • bg maps to base00
  • warn maps to base0A

Blends

These are derived by blending two colors together to varying degrees. For example, the cursorline color is base07 blended with a bit of base00, making it just slightly brighter than the background.

Shout out to folke’s Tokyo Night colorscheme for the blending functions used to implement this functionality.

Usage

The most basic Iris setup looks like:

require("iris").setup({})

This, however, isn’t terribly useful. Iris accepts a table of optional settings:

  • callbacks: A list of functions, each accepting an Iris palette as an argument, that will be run each time Iris generates a new palette. This is where the action is.
  • palettes: A list of tables defining custom palettes for matching colorschemes.
  • autocmd: If set to false, Iris will not add an autocommand to regenerate the palette and run the callbacks on the ColorScheme event. This can be done manually by running :lua require("iris").load().

The following setup will display the Iris palette each time it is generated and use a custom palette for the Srcery colorscheme:

require("iris").setup({
  callbacks = {
    function (pal) print(vim.inspect(pal) end, 
  },
  palettes = {
    srcery = require("my_srcery_palette"), 
  }
})

Portabilty

The iris module provides a json function that returns the current palette as a JSON-encoded string. This is handy for passing color settings off to external programs.

Examples

Contributing

Pull requests and issues are welcome; please adhere to the Code of Conduct.

Owner
N. G. Scheurich
Scholar of arcane mysteries such as computer programming, game design, and ancient text editors.
N. G. Scheurich
Python script to tabulate data formats like json, csv, html, etc

pyT PyT is a a command line tool and as well a library for visualising various data formats like: JSON HTML Table CSV XML, etc. Features Print table o

Mobolaji Abdulsalam 1 Dec 30, 2021
Python CLI utility and library for manipulating SQLite databases

sqlite-utils Python CLI utility and library for manipulating SQLite databases. Some feature highlights Pipe JSON (or CSV or TSV) directly into a new S

Simon Willison 1.1k Jan 04, 2023
Magma is a NeoVim plugin for running code interactively with Jupyter.

Magma Magma is a NeoVim plugin for running code interactively with Jupyter. Requirements NeoVim 0.5+ Python 3.8+ Required Python packages: pynvim (for

Daniel Csillag 372 Dec 26, 2022
A Python package for Misty II development

Misty2py Misty2py is a Python 3 package for Misty II development using Misty's REST API. Read the full documentation here! Installation Poetry To inst

Chris Scarred 1 Mar 07, 2022
Hack-All is a simple CLI tool that helps ethical-hackers to make a reverse connection without knowing the target device in use is it computer or phone

Hack-All is a simple CLI tool that helps ethical-hackers to make a reverse connection without knowing the target device in use is it computer

LightYagami17 5 Nov 22, 2022
vimBrain is a brainfuck-based vim-inspired esoteric programming language.

vimBrain vimBrain is a brainfuck-based vim-inspired esoteric programming language. vimBrainPy Currently, the only interpreter available is written in

SalahDin Ahmed 3 May 08, 2022
A command line tool that creates a super timeline from SentinelOne's Deep Visibility data

S1SuperTimeline A command line tool that creates a super timeline from SentinelOne's Deep Visibility data What does it do? The script accepts a S1QL q

Juan Ortega 2 Feb 08, 2022
Simple tool, to update linux kernel on ubuntu

Kerbswap Simple tool, to update linux kernel on ubuntu Information At the moment, this tool only supports "Ubuntu" distributions, but will be expanded

dword 1 Oct 31, 2021
AWS Interactive CLI - Allows you to execute a complex AWS commands by chaining one or more other AWS CLI dependency

AWS Interactive CLI - Allows you to execute a complex AWS commands by chaining one or more other AWS CLI dependency

Rafael Torres 2 Dec 10, 2021
Command-line interface to PyPI Stats API to get download stats for Python packages

pypistats Python 3.6+ interface to PyPI Stats API to get aggregate download statistics on Python packages on the Python Package Index without having t

Hugo van Kemenade 140 Jan 03, 2023
:computer: tmux session manager. built on libtmux

tmuxp, tmux session manager. built on libtmux. We need help! tmuxp is a trusted session manager for tmux. If you could lend your time to helping answe

python utilities for tmux 3.6k Jan 01, 2023
Un module simple pour demander l'accord de l'utilisateur dans une CLI.

Demande de confirmation utilisateur pour CLI Présentation ask_lib est un module pour le langage Python proposant une seule fonction; ask(). Le but pri

CallMePixelMan 7 May 09, 2022
An interactive cheatsheet tool for the command-line

navi An interactive cheatsheet tool for the command-line. navi allows you to browse through cheatsheets (that you may write yourself or download from

Denis Isidoro 12.2k Dec 31, 2022
Terminal Colored Text for Python

Terminal Colored Text for Python

R3CKhi-**75 3 Sep 10, 2022
Linux commands Interpreter for Windows and Mac based systems using Python

DBHTermEcIbP Linux commands Interpreter for Windows and Mac based systems using Python Basic Linux commands supported viewing current working director

Vraj Patel 1 Dec 26, 2021
Turdshovel is an interactive CLI tool that allows users to dump objects from .NET memory dumps

Turdshovel Description Turdshovel is an interactive CLI tool that allows users to dump objects from .NET memory dumps without having to fully understa

Leron Gray 41 Jul 27, 2022
Albert launcher extension for converting units of length, mass, speed, temperature, time, current, luminosity, printing measurements, molecular substance, and more

unit-converter-albert-ext Extension for converting units of length, mass, speed, temperature, time, current, luminosity, printing measurements, molecu

Jonah Lawrence 2 Jan 13, 2022
A simple CLI application helps you to find giant files that are eating up your system storage

Large file finder Sometimes it's very hard to find if some giant files are eating up your system storage. We might need to hunt those down. This simpl

Rahul Baruri 5 Nov 18, 2022
Python library and command line tool for interacting with Bugzilla

python-bugzilla This package provides two bits: bugzilla python module for talking to a Bugzilla instance over XMLRPC or REST /usr/bin/bugzilla comman

Python Bugzilla Project 112 Nov 05, 2022
Chat In Terminal - Chat-App in python

Chat In Terminal Hello all. 😉 Sockets and servers are vey important for connection and importantly chatting with others. 😂 😁 I have thought of maki

Shreejan Dolai 5 Nov 17, 2022