All Projects → trapd00r → File-LsColor

trapd00r / File-LsColor

Licence: other
Colorize input filenames just like ls(1) does

Programming Languages

perl
6916 projects
shell
77523 projects

Projects that are alternatives of or similar to File-LsColor

ls
Zsh plugin for ls
Stars: ✭ 73 (+121.21%)
Mutual labels:  coreutils, ls
sourcerer
read code like a wizard. a 16bit color scheme for hackers
Stars: ✭ 136 (+312.12%)
Mutual labels:  colors, terminal-colors
tamcolors
tamcolors is a terminal game library which supports multiplayer and audio. tamcolors gives a buffer which lets the user set the character, foreground color and background color which can draw at a stable FPS of 25 on all supported console.
Stars: ✭ 24 (-27.27%)
Mutual labels:  colors, terminal-colors
Tints And Shades
🌈 Display tints and shades of a given hex color in 10% increments.
Stars: ✭ 228 (+590.91%)
Mutual labels:  colors
Huge Collection Of Cheatsheet
Share of my Huge Collection of Cheatsheet (Coding, Cheat, Pinouts, Command Lists, Etc.)
Stars: ✭ 250 (+657.58%)
Mutual labels:  colors
tailwind-css-palette-generator
10-color Palette Generator and API for Tailwind CSS
Stars: ✭ 206 (+524.24%)
Mutual labels:  colors
colorblindcheck
Tools helping to decide if a color palette is colorblind friendly
Stars: ✭ 21 (-36.36%)
Mutual labels:  colors
Nova Colors
Single source of truth to consume Nova color values
Stars: ✭ 217 (+557.58%)
Mutual labels:  colors
UIImageColorRatio
A tool to calculate the color ratio of UIImage in iOS.
Stars: ✭ 34 (+3.03%)
Mutual labels:  colors
license-ls
Get a list of licenses used by a projects dependencies
Stars: ✭ 17 (-48.48%)
Mutual labels:  ls
bliss-zsh
A delicate Zsh theme that injects color without overwhelming your workspace
Stars: ✭ 20 (-39.39%)
Mutual labels:  terminal-colors
slick
Vim/Neovim Colortheme–Truecolor, Stunning, Complete
Stars: ✭ 15 (-54.55%)
Mutual labels:  colors
hackerinnen
hackerinnen.space is a project to provide encouragement and enhance visibility in different places
Stars: ✭ 22 (-33.33%)
Mutual labels:  colors
Ac Colors
ac-colors is a reactive JavaScript color library that can freely convert between RGB, HSL, HEX, XYZ, LAB, LCHab, LUV, and LCHuv, as well as handle random color generation and contrast ratio calculation.
Stars: ✭ 243 (+636.36%)
Mutual labels:  colors
ll
ll - a more informative `ls`, based on `k`
Stars: ✭ 24 (-27.27%)
Mutual labels:  ls
Androidphotoshopcolorpicker
A fully featured Color picker Library for Android
Stars: ✭ 220 (+566.67%)
Mutual labels:  colors
conic.css
nice'n simple conic gradients 🎨
Stars: ✭ 195 (+490.91%)
Mutual labels:  colors
HexTags
Customize tags & chat colors!
Stars: ✭ 53 (+60.61%)
Mutual labels:  colors
charmed-dark-xcode-theme
A charming and colorful dark theme for Xcode 🌈.
Stars: ✭ 172 (+421.21%)
Mutual labels:  colors
SomaFM
A simple Python 3.x terminal interface for streaming SomaFM
Stars: ✭ 27 (-18.18%)
Mutual labels:  terminal-colors

Donate - Every tiny cent helps a lot!

NAME

File::LsColor - Colorize input filenames just like ls does

SYNOPSIS

use File::LsColor qw(:all);
# Is equal to:
use File::LsColor qw(
  ls_color
  ls_color_custom
  ls_color_default
  ls_color_internal
);

my @files = glob("$ENV{HOME}/*");

print ls_color($_), "\n" for(@files);

# or specify own pattern

@files = ls_color_custom('*.pl=38;5;196;1:*.pm=38;5;220', @files);

# or use the internal mappings

@files = ls_color_internal(@files);

# or use the defaults (only ANSI colors)

@files = ls_color_default(@files);

...

# returns a hashref with all defined filetypes and their attributes
my $ls_colors = get_ls_colors();

# what's the defined attributes for directories?

my $dir_color = lookup_ls_color('di');

DESCRIPTION

This module provides functionality for using the LS_COLORS variable for colorizing output in a way that's immediately recognized.

Say that you have a list of filenames that's the result of some complex operation, and you wish to present the result to the user.

If said files have an extension and that extension is present in the users LS_COLORS variable, they will be colored just like they would have been if the filenames were output from ls(1) or tree(1).

EXPORTS

None by default.

FUNCTIONS

ls_color()

Arguments: @files | \@files

Returns: $files | @files

Returns a list of filenames colored as specified by the environment LS_COLORS variable. If the LS_COLORS variable is not set, throws an exception. In this case, ls_color_internal() can be used.

In scalar context a string joined by '' is returned.

ls_color_default()

The same thing as ls_color(), but uses the default LS_COLORS values from GNU ls. Those are only ANSI colors.

ls_color_internal()

The same as ls_color(), with one minor difference; Instead of using the LS_COLORS variable from the environment, an internal specification is used. This specification contains about 250 extensions as of this writing.

ls_color_custom()

The first argument to ls_color_custom() should be a valid LS_COLORS definition, like so:

ls_color_custom("*.pl=38;5;196:*.pm=38;5;197;1", @perl_files);

get_ls_colors()

Returns a hash reference where a key is the extension and its value is the attributes attached to it.

lookup_ls_color()

Given a valid name, returns the defined attributes associated with it. Else, returns undef.

File::LsColor out in the wild

AUTHOR

Magnus Woldrich
CPAN ID: WOLDRICH
[email protected]
http://japh.se
https://github.com/trapd00r

REPORTING BUGS

Report bugs on https://github.com/trapd00r/File-LsColor or to [email protected]

COPYRIGHT

Copyright 2011, 2018, 2019- the File::LsColor "AUTHOR" and "CONTRIBUTORS" as listed above.

LICENSE

This library is free software; you may redistribute it and/or modify it under the same terms as Perl itself.

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