Skip to content

Commit

Permalink
(mini.hues) NEW MODULE: initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
echasnovski committed May 7, 2023
1 parent cd628e1 commit ce94001
Show file tree
Hide file tree
Showing 12 changed files with 2,695 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- Use Lua API to create autocommands. Stop exporting functions only related to autocommands.
- Use Lua API to create default highlight groups.
- Use `vim.keymap` to deal with mappings. Stop exporting functions only related to mappings.
- Add 'randomhue' color scheme.

# mini.base16

Expand All @@ -22,6 +23,10 @@

Introduction of a new module.

# mini.hues

Introduction of a new module.


# Version 0.8.0

Expand Down
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ Here are code snippets for some common installation methods:
| mini.cursorword | Autohighlight word under cursor | [README](readmes/mini-cursorword.md) | [Help file](doc/mini-cursorword.txt) |
| mini.doc | Generate Neovim help files | [README](readmes/mini-doc.md) | [Help file](doc/mini-doc.txt) |
| mini.fuzzy | Fuzzy matching | [README](readmes/mini-fuzzy.md) | [Help file](doc/mini-fuzzy.txt) |
| mini.hues | Generate configurable color scheme | [README](readmes/mini-hues.md) | [Help file](doc/mini-hues.txt) |
| mini.indentscope | Visualize and work with indent scope | [README](readmes/mini-indentscope.md) | [Help file](doc/mini-indentscope.txt) |
| mini.jump | Jump to next/previous single character | [README](readmes/mini-jump.md) | [Help file](doc/mini-jump.txt) |
| mini.jump2d | Jump within visible lines | [README](readmes/mini-jump2d.md) | [Help file](doc/mini-jump2d.txt) |
Expand Down Expand Up @@ -114,24 +115,24 @@ Here are code snippets for some common installation methods:

- **Silencing**. Each module providing non-error feedback can be configured to not do that by setting `config.silent = true` (either inside `setup()` call or on the fly).

- **Highlight groups**. Appearance of module's output is controlled by certain highlight group (see `:h highlight-groups`). To customize them, use `highlight` command. **Note**: currently not many Neovim themes support this plugin's highlight groups; fixing this situation is highly appreciated. To see a more calibrated look, use MiniBase16 or plugin's colorscheme `minischeme`.
- **Highlight groups**. Appearance of module's output is controlled by certain highlight group (see `:h highlight-groups`). To customize them, use `highlight` command. **Note**: currently not many Neovim themes support this plugin's highlight groups; fixing this situation is highly appreciated. To see a more calibrated look, use 'mini.hues', 'mini.base16', or any of plugin's colorscheme.

- **Stability**. Each module upon release is considered to be relatively stable: both in terms of setup and functionality. Any non-bugfix backward-incompatible change will be released gradually as much as possible.

## Plugin colorschemes

This plugin comes with several color schemes (all of them are made with 'mini.base16' and have both dark and light variants):
This plugin comes with several color schemes (all have both dark and light variants):

- `minischeme` - blue and yellow main colors with high contrast and saturation palette. All examples use this colorscheme.
- `minicyan` - cyan and grey main colors with moderate contrast and saturation palette.
- `randomhue` - random background and foreground of the same hue with medium saturation.
- `minicyan` - cyan and grey main colors with medium contrast and saturation palette.
- `minischeme` - blue and yellow main colors with high contrast and saturation palette.

Activate them as regular `colorscheme` (for example, `:colorscheme minicyan`). You can see how they look in [demo of 'mini.base16'](readmes/mini-base16.md#demo).
Activate them as regular `colorscheme` (for example, `:colorscheme randomhue` or `:colorscheme minicyan`). You can see how they look in [demo of 'mini.hues'](readmes/mini-hues.md#demo) or [demo of 'mini.base16'](readmes/mini-base16.md#demo).

## Planned modules

This is the list of modules I currently intend to implement eventually (as my free time and dedication will allow), in alphabetical order:

- 'mini.base3' - a configurable color scheme taking only three colors: background, foreground, and accent. Similar to an upgraded version of 'mini.base16' with builtin-in palette generator.
- 'mini.clue' - "show as you type" floating window with customizable information. Something like [folke/which-key.nvim](https://github.com/folke/which-key.nvim) and [anuvyklack/hydra.nvim](https://github.com/anuvyklack/hydra.nvim)
- 'mini.colortext' - automatically highlight some common text (color strings, "TODO", etc.). Similar to colorizer capabilities of [uga-rosa/ccc.nvim](https://github.com/uga-rosa/ccc.nvim) and [folke/todo-comments.nvim](https://github.com/folke/todo-comments.nvim).
- 'mini.filetree' - file tree viewer. Simplified version of [nvim-tree/nvim-tree.lua](https://github.com/nvim-tree/nvim-tree.lua).
Expand Down
16 changes: 16 additions & 0 deletions colors/randomhue.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
local hues = require('mini.hues')

-- Generate random config with initialized random seed (otherwise it won't be
-- random during startup)
math.randomseed(vim.loop.hrtime())
local base_colors = hues.gen_random_base_colors()

hues.setup({
background = base_colors.background,
foreground = base_colors.foreground,
n_hues = 8,
saturation = vim.o.background == 'dark' and 'medium' or 'high',
accent = 'bg',
})

vim.g.colors_name = 'randomhue'
Loading

0 comments on commit ce94001

Please sign in to comment.