All Projects โ†’ neeasade โ†’ colort

neeasade / colort

Licence: MIT license
colort[int]

Programming Languages

c
50402 projects - #5 most used programming language
shell
77523 projects
Makefile
30231 projects

Projects that are alternatives of or similar to colort

razer-cli
CLI for configuring Razer devices
Stars: โœญ 46 (+64.29%)
Mutual labels:  rice, colors
nyoom.nvim
Blazing fast, configurable, minimal and lispy neovim config written in Fennel and Rust. Base config for users to extend and add upon, leading to a more unique editing experience. (๐Ÿš€)
Stars: โœญ 304 (+985.71%)
Mutual labels:  rice
anypalette.js
๐ŸŽจ Read/write all color palette file formats โค๐Ÿงก๐Ÿ’›๐Ÿ’š๐Ÿ’™๐Ÿ’œ
Stars: โœญ 41 (+46.43%)
Mutual labels:  colors
console-logging
Better, prettier commandline logging for Python--with colors! ๐Ÿ‘ป
Stars: โœญ 111 (+296.43%)
Mutual labels:  colors
concolor
Colouring template strings using tags with annotations ๐ŸŽจ
Stars: โœญ 35 (+25%)
Mutual labels:  colors
dotfiles
files that start . and makes my Linux box awesome.
Stars: โœญ 57 (+103.57%)
Mutual labels:  rice
go-rainbow
Golang Helper for beautiful CLI Applications
Stars: โœญ 86 (+207.14%)
Mutual labels:  colors
rainbow.sh
Simple colors for your bash scripts
Stars: โœญ 41 (+46.43%)
Mutual labels:  colors
CLE
Command Live Environment
Stars: โœญ 21 (-25%)
Mutual labels:  colors
dotfiles
My personal dotfiles repository
Stars: โœญ 36 (+28.57%)
Mutual labels:  rice
camalian
Library used to deal with colors and images. You can extract colors from images.
Stars: โœญ 45 (+60.71%)
Mutual labels:  colors
i3blocks-crypto
๐Ÿ’ต View your favorite coins' ticker prices with i3blocks.
Stars: โœญ 30 (+7.14%)
Mutual labels:  rice
BetterConsoleTables
Faster, colorable, more configurable, and more robust console colors & tables for C# console applications
Stars: โœญ 59 (+110.71%)
Mutual labels:  colors
pantone-colors
Hex values of all 2310 Pantone colors
Stars: โœญ 147 (+425%)
Mutual labels:  colors
nix-rice
A library to functionally define your configuration and theme (rice) with Nix
Stars: โœญ 43 (+53.57%)
Mutual labels:  rice
PlantUML-colors
This script is to show all named color suggested by PlantUML
Stars: โœญ 52 (+85.71%)
Mutual labels:  colors
hex-rgba
Convert HEX to RGBA
Stars: โœญ 12 (-57.14%)
Mutual labels:  colors
global-color-picker
start the script and click anywhere to get rgb value at the cursor location
Stars: โœญ 31 (+10.71%)
Mutual labels:  colors
kolorist
A tiny utility to colorize stdin/stdout
Stars: โœญ 160 (+471.43%)
Mutual labels:  colors
hsluv-c
C99 implementation of HSLuv (revision 4)
Stars: โœญ 71 (+153.57%)
Mutual labels:  colors

colort[int]

A small program for 'tinting' colors by values. Also supports inverting colors.

command output
colort 1 "#000000" #010101
colort -l 1 "#FFFFFF" #FFFFFF
colort -l 1 "#FFFFFF" #FFFFFF, exit status 0
colort -i "#000000" #FFFFFF
colort 60 "#000000" #3C3C3C
colort -60 "#000000" #C4C4C4
colort -s 4 1 "spam000000spam" spam010101spam
colort -t -s 4 1 "spam000000spam" 010101
colort -t "ff000000" 000000
colort -r 1 "#000000" #010000

Notes:

  • The color is assumed to be the last 6 chars of the input string (can be changed with -s)
  • If the tint value is omitted, defaults to 0.
  • The -l flag limits color tinting by not letting values roll around.
    • if 2 or more of RGB is limited when this is turned on, exit status of 1.
  • The -i flag inverts colors.
  • The -s flag selects the index in the input string to start getting color from.
  • The -t flag makes the output only the color string
  • The -c flag calculates the contrast of the color. If this evaluates to black, exit status 0. If white, exit status 1.
  • If the -r, -g, or -b flags are used, red, green, or blue are affected by the operation respectively.
  • The tint value can be within the set of values supported by a long datatype.

Example use cases:

Invert a background color to have readable text on any background:

1 2 3

Auto-determine select and icon colors for GTK themes based on the background (using oomox and acyl in these examples)

  • Select_color="$(colort -c "$BG" && colort 25 "$BG" || colort -25 "$BG")"
    • If the background contrast is 'dark', tint up, else tint down.
  • Icon_color="$(colort -c "$BG" && colort -l 80 "$BG" || colort -l -80 "$BG")"
    • the same logic, but tinted further to make icons more bold, and a flag to top out at white or black.
1 2 3

If for some reason we wanted everything to have a blue tint, we can wrap both the above calls with a colort -b 40:

1 2 3

Input background colors used for the examples: 282828, AB4642, D8D8D8 from base16 colorsets.

TODO

  • consider accepting input from STDIN
  • update the man page
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].