Categories
Uncategorized

colortrans

colortrans is a color transfer Python library that I recently implemented. It includes an assortment of algorithms for transferring the colors from a reference image to a content image while preserving the qualitative appearance of the content image.

I’ve written a document, colortrans.pdf, that describes the implemented algorithms.

The library is available on PyPI and can be installed with pip.

$ pip3 install colortrans

The source code and documentation is available on GitHub:
https://github.com/dstein64/colortrans

Categories
Uncategorized

nvim-scrollview

I recently implemented nvim-scrollview, a Neovim plugin that displays interactive scrollbars.

The scrollbars serve as a visual aid, which can be helpful in addition to the position information already provided in the status line. The main features are 1) handling for folds, 2) support for mouse dragging, and 3) partial transparency so that text is not covered. Scrollbar generation and refreshing work automatically.

The plugin is implemented primarily in Vimscript, but requires Neovim 0.5 for its WinScrolled event. Additionally, Neovim’s built-in support for Lua was utilized to speed up processing.

The source code—along with installation instructions—is available on GitHub:
https://github.com/dstein64/nvim-scrollview

Categories
Uncategorized

Auto Highlight Updates

Auto Highlight—discussed in a prior post—was released over five years ago, on April 24, 2015. The browser extension is intended for automatically highlighting the important content on article web pages.

As shown by the GitHub contributions chart below, development was mostly inactive for a few years following the initial release.

I’ve recently added additional features. Thanks to the users who suggested some of these!

☰ Context Menu

The extension permits three levels of highlighting. As of v2.1.0, it’s possible to use the context menu to directly apply the desired level of highlighting, rather than cycling through the levels. Additionally, controls for Global Highlighting and Autonomous Highlights—both discussed below—are available on the context menu.

The menu can be accessed by right-clicking either 1) the Auto Highlight icon in the browser toolbar, or 2) the currently open web page. In either case, the icons are shown only on Firefox, as Chrome and Edge do not currently support context menu icons below the top level.

Categories
Uncategorized

revdoor

revdoor is a single-file C++ library for visiting revolving door combinations.

The combinations without replacement generator implements Algorithm R from TAOCP 7.2.1.3 [1]. The combinations with replacement generator implements the same algorithm, modified to support replacement.

The algorithms visit combinations by indicating at most two pairs of items to swap in and out on each iteration.

The source code is available on GitHub:
https://github.com/dstein64/revdoor

Categories
Uncategorized

vim-startuptime and vim-win

I recently implemented two Vim plugins (they also work on Neovim).

vim-startuptime

vim-startuptime is a plugin for viewing Vim startup event timing—reported in milliseconds. This can be helpful when trying to modify your configuration to improve Vim’s startup time.

  • Launch vim-startuptime with :StartupTime.
  • Press <space> on events to get additional information.
  • Press <enter> on sourcing events to load the corresponding file in a new split.
  • Access documentation with :help vim-startuptime.

The source code—along with installation instructions—is available on GitHub:
https://github.com/dstein64/vim-startuptime

vim-win

vim-win is a plugin for managing windows, including 1) selecting windows, 2) swapping window buffers, and 3) resizing windows. Full functionality requires vim>=8.2 or nvim>=0.4.0.

  • Enter vim-win with <leader>w or :Win.
  • Arrows or hjkl keys are used for movement.
  • Change windows with movement keys or numbers.
  • Hold <shift> and use movement keys to resize the active window.
  • Press s or S followed by a movement key or window number, to swap buffers.
  • Press ? to show a help message.
  • Press <esc> to leave vim-win.
  • Access documentation with :help vim-win.

The source code—along with installation instructions—is available on GitHub:
https://github.com/dstein64/vim-win