🌈 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.

You might also like...
Basic python tools to generate shellcode runner in vba

vba_bin_runner Basic python tools to generate shellcode runner in vba. The stub use ZwAllocateVirtualMemory to allocate memory, RtlMoveMemory to write

command line tool for frequent nmigen tasks (generate sources, show design)
command line tool for frequent nmigen tasks (generate sources, show design)

nmigen-tool command line tool for frequent nmigen tasks (generate sources, show design) Usage: generate verilog: nmigen generate verilog nmigen_librar

🌌 A Python script to generate blog banners from command line.
🌌 A Python script to generate blog banners from command line.

Auto Blog Banner Generator A Python script to generate blog banners. This script is used at RavSam. The following image is an example of the blog bann

AutoSub is a CLI application to generate subtitle files (.srt, .vtt, and .txt transcript) for any video file using Mozilla DeepSpeech.

AutoSub About Motivation Installation Docker How-to example How it works TO-DO Contributing References About AutoSub is a CLI application to generate

Fun project to generate The Matrix Code effect on you terminal.
Fun project to generate The Matrix Code effect on you terminal.

Fun project to generate The Matrix Code effect on you terminal.

The Pythone Script will generate a (.)sh file with reverse shell codes then you can execute the script on the target

Pythone Script will generate a (.)sh file with reverse shell codes then you can execute the script on the targetPythone Script will generate a (.)sh file with reverse shell codes then you can execute the script on the target

Generate an ASCII Art from keyword put in the cli

ascii-art-generator-cli Generate an ASCII Art from keyword put in the cli Install git clone https://github.com/Nathanlauga/ascii-art-generator-cli cd

A CLI tool for using GLIDE to generate images from text.
A CLI tool for using GLIDE to generate images from text.

Text-Glided-Diffusion Installation First clone this repository: git clone https://github.com/afiaka87/text-glided-diffusion.git cd text-glided-diffusi

This is a CLI program which can help you generate your own QR Code.

Python-QR-code-generator This is a CLI program which can help you generate your own QR Code. Single.py This will allow you only to input a single mess

Owner
N. G. Scheurich
Scholar of arcane mysteries such as computer programming, game design, and ancient text editors.
N. G. Scheurich
Jupyter notebook client in neovim

?? Jupyter-Nvim Read jupyter notebooks in neovim Note: The plugin is still in alpha stage ?? Usage Just open any *.ipynb file and voila! ✨ Contributin

Ahmed Khalf 85 Dec 29, 2022
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
Neovim integration for Google Keep, built using gkeepapi

Gkeep.nvim Neovim integration for Google Keep, built using gkeepapi Requirements Neovim 0.5 Python 3.6+ A patched font (optional. Used for icons) Tabl

Steven Arcangeli 143 Jan 2, 2023
Freaky fast fuzzy Denite/CtrlP matcher for vim/neovim

Freaky fast fuzzy Denite/CtrlP matcher for vim/neovim This is a matcher plugin for denite.nvim and CtrlP.

Raghu 113 Sep 29, 2022
Bringing emacs' greatest feature to neovim - Tetris!

nvim-tetris Bringing emacs' greatest feature to neovim - Tetris! This plugin is written in Fennel using Olical's project Aniseed for creating the proj

null 129 Dec 26, 2022
🦎 A NeoVim plugin for highlighting visual selections like in a normal document editor!

?? HighStr.nvim A NeoVim plugin for highlighting visual selections like in a normal document editor! Demo TL;DR HighStr.nvim is a NeoVim plugin writte

Pocco81 222 Jan 3, 2023
Simple Python Library to display text with color in Python Terminal

pyTextColor v1.0 Introduction pyTextColor is a simple Python Library to display colorful outputs in Terminal, etc. Note: Your Terminal or any software

Siddhesh Chavan 1 Jan 23, 2022
This is an app for creating your own color scheme for Termux!

Termux Terminal Theme Creator [WIP] If you need help on how to use the program, you can either create a GitHub issue or join this temporary Discord se

asxlvm 3 Dec 31, 2022
Color preview command-line tool written in python

Color preview command-line tool written in python

Arnau 1 Dec 27, 2021
Command line tool to automate transforming the effects of one color profile to another, possibly more standard one.

Finished rendering the frames of that animation, and now the colors look washed out and ugly? This terminal program will solve exactly that.

Eric Xue 1 Jan 26, 2022