All Projects → secretBiology → SecretColors

secretBiology / SecretColors

Licence: MIT license
Python package for fantastic colors :)

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to SecretColors

mq-java-exporter
Exporter for IBM MQ metrics https://prometheus.io/
Stars: ✭ 19 (-38.71%)
Mutual labels:  ibm
terraform-module-icp-deploy
This Terraform module can be used to deploy IBM Cloud Private on any supported infrastructure vendor. Tested on Ubuntu 16.04 and RHEL 7 on SoftLayer, VMware, AWS and Azure.
Stars: ✭ 13 (-58.06%)
Mutual labels:  ibm
color-loader
🎨 A webpack loader that extracts the color palette of an image
Stars: ✭ 14 (-54.84%)
Mutual labels:  color-palette
AsBuiltReport.VMware.vSphere
Repository for AsBuiltReport VMware vSphere module
Stars: ✭ 75 (+141.94%)
Mutual labels:  vmware-vsphere
react-colorscales
A React UI component for picking and modifying colorscales
Stars: ✭ 36 (+16.13%)
Mutual labels:  color-palette
Quantum-Computing-Resources
This repository contains the best resources for learning practical quantum computing. This repository will be updated frequently.
Stars: ✭ 60 (+93.55%)
Mutual labels:  ibm
palettify
Configurable JavaScript plugin to extract image primary colors and apply cool effects to it.
Stars: ✭ 18 (-41.94%)
Mutual labels:  color-palette
Extract-Color-Palette-Api
Create gradient drawable by extracting prominent colors from image⚫⚪
Stars: ✭ 16 (-48.39%)
Mutual labels:  color-palette
platform-services-go-sdk
Go client library for IBM Cloud Platform Services
Stars: ✭ 14 (-54.84%)
Mutual labels:  ibm
icingaweb2-module-vspheredb
The easiest way to monitor a VMware vSphere environment.
Stars: ✭ 88 (+183.87%)
Mutual labels:  vmware-vsphere
distinctipy
A lightweight package for generating visually distinct colours.
Stars: ✭ 125 (+303.23%)
Mutual labels:  color-palette
pantone-colors
Hex values of all 2310 Pantone colors
Stars: ✭ 147 (+374.19%)
Mutual labels:  color-palette
vsphere-automation-sdk-.net
[DEPRECATED] Please see README. C# samples, language bindings, and API reference documentation for vSphere, VMC, and NSX-T using the VMware REST API
Stars: ✭ 67 (+116.13%)
Mutual labels:  vmware-vsphere
tcolors
Commandline color picker and palette builder
Stars: ✭ 44 (+41.94%)
Mutual labels:  color-palette
nlc-email-phishing
Detect email phishing with Watson Natural Language Classifier
Stars: ✭ 26 (-16.13%)
Mutual labels:  ibm
materialdesign
Resources for Google's Material Design
Stars: ✭ 52 (+67.74%)
Mutual labels:  google-material
Linux-System-Info-Webpage
Material Design Dashboard for Linux System Info. Great for RPi and other linux Distros
Stars: ✭ 19 (-38.71%)
Mutual labels:  google-material
text-bot-openwhisk
DEPRECATED: this repo is no longer actively maintained
Stars: ✭ 12 (-61.29%)
Mutual labels:  ibm
CVE-2020-4463
IBM Maximo Asset Management is vulnerable to Information Disclosure via XXE Vulnerability (CVE-2020-4463)
Stars: ✭ 41 (+32.26%)
Mutual labels:  ibm
material-ui-color
The lightest colorpicker, palette, colorinput, colorbutton ⚡ No dependencies. It uses React hooks, support Typescript theming and more !
Stars: ✭ 125 (+303.23%)
Mutual labels:  color-palette

SecretColors

PyPI version Documentation Status

Library generated for making plots with better color palette. It uses famous color palettes and adds few helpful functions.

Currently it supports following Color Palettes

  • IBM Color Palette (ibm)
  • Google Material Design Color Palette (material)
  • Google Material Design Accent Color Palette (material-accent)
  • ColorBrewer2 Color Palette (brewer)
  • VMWare Clarity Color Palette (clarity)
  • Tableau Color Palette (tableau)

You can get output of colors in variety of color formats including hex , rgb, rgba etc.

See changelog to know what's new!

Few sample plots and inspiration behind this library can be found in WeirdData blog.

Default base colors in matplotlib and SecretColors palettes.
Simple bar plot with default colors.
Histogram comparison with Magenta and Cyan. You can dramatically change colors by just passing single parameter.

Installation

pip install SecretColors

Documentation

Full documentation and API reference can be accessed via ReadTheDocs

SecretColors is a very flexible library. You can easily select different color palettes.

from SecretColors import Palette

p = Palette()  # Generates Default color palette i.e. IBM Color Palette
ibm = Palette("ibm")  # Generates IBM Palette
ibm.red()  # Returns '#fb4b53'
material = Palette("material")  # Generates Material Palette
material.red()  # Returns '#f44336'

Select different types of color modes

p1 = Palette() # Default Color mode (hex)
p1.green() # '#24a148'
p2 = Palette(color_mode="hexa")
p2.green() # '#24a148ff'
p3 = Palette(color_mode="ahex")
p3.green() # '#ff24a148'
p4 = Palette(color_mode="rgb")
p4.green() # (0.141, 0.631, 0.282)
p5 = Palette(color_mode="rgba")
p5.green() # '(0.141, 0.282, 0.631, 1)'

Note: matplotlib can accepts hex, rgb or hexa

Get random colors

p = Palette()
p.random() # '#90dbe9'
p.random(no_of_colors=3) # ['#8fca39', '#64a0fe', '#7430b6']
p.random(no_of_colors=2, shade=20) # ['#b3e6ff', '#c2dbf4']

Unlimited color manipulations

p = Palette()
p.blue()  # normal blue [#408bfc]
p.blue(shade=20)  # lighter shade of blue [#c9deff]
p.blue(shade=70)  # darker shade of blue [#054ada]
p.blue(shade=16.10)  # arbitrary shade of blue (between 0 to 100) [#dbe9ff]
p.blue(no_of_colors=3)  # Three blue shades ['#b8d4ff', '#408bfc', '#0546d4']
p.blue(no_of_colors=3, starting_shade=30)  # Three blue shades with lightest one is 30 ['#64a0fe', '#005ef9', '#052ea8']
p.blue(no_of_colors=3, ending_shade=40)  # Three blue shades with darkest one is 40 ['#edf4ff', '#c9deff', '#97c1ff']
p.blue(no_of_colors=3, starting_shade=30, ending_shade=40) # Three blue shades with lightest 30 and darkest 60 ['#8cbaff', '#8cbaff', '#8cbaff']
p.blue(no_of_colors=3, gradient=False) # Three blue shades in random order ['#8cbaff', '#b8d4ff', '#64a0fe']
p.color_mode = "rgba"
p.blue(alpha=0.3) # Blue with alpha (0.251, 0.988, 0.545, 0.3) Only works in color mode which outputs alpha values

Flexible functions

get_complementary("#24a148") # Get complementary color [#a0237c]
hex_to_rgb("#a0237c") # (0.627, 0.137, 0.486)
hex_to_hsl("#a0237c") # (0.881, 0.641, 0.382)
hex_to_hex_a("#a0237c", alpha=0.7) # Get hex with transparency at end [#a0237cb2]
hex_to_ahex("#a0237c", alpha=0.7) # Get hex with transparency at start [#b2a0237c]
color_in_between("#24a148","#a0237c") # Color between two ['#616161']
color_in_between("#24a148","#a0237c", steps=4) # 3 colors between two ['#428154', '#616161', '#80426e'] such that color space is divided into 4 parts
rgb_to_hex(0.181, 0.241, 0.382) # '#2e3d61'
rgb_to_hsl(0.181, 0.241, 0.382) # (0.617, 0.357, 0.281)
hsl_to_hex(0.181, 0.241, 0.382) # '#747849'

Custom and flexible colormaps which can be directly used in matplotlib workflow

import matplotlib
import matplotlib.pylab as plt
import numpy as np
from SecretColors.cmaps import ColorMap
from SecretColors import Palette
p = Palette()
c = ColorMap(matplotlib, p)
data = np.random.rand(100, 100)
plt.pcolor(data, cmap=c.greens())
plt.show()

Create your own colormaps or make it qualitative colormap

color_list = [p.red(), p.blue()]
plt.pcolor(data, cmap=c.from_list(color_list, is_qualitative=True))
plt.show()

Reverse the direction

plt.pcolor(data, cmap=c.greens(is_reversed=True))

TODO

  • CIE XYZ to CIE Lab conversions
  • Color Palettes - Latitude, Polaris, Adobe Spectrum
  • Direct support for more RGB to XYZ conversions
  • Generate Color Palette from image
  • Color blind safe palette
  • Out of the box LinearSegmentedColormap object

We can not implement 'out of the box' colormaps for matplotlib because matplotlib checks its type before its use. Hence we can not make new class which can be directly act as a substitute.

Note: All CIE-XYZ conversion and colorblind simulation functions are still in beta-testing. Do not use them in your production code

Contribution and Feedback

Feel free to provide feedback and criticism through GitHub or you can email me [email protected] . If you want to contribute, please send pull request to this repository.

Acknowledgments

Colors used in this library are partly taken from IBM Design Language , Google Material Design , ColorBrewer, VMWare Clarity and Tableau .

Color name data is taken from X11 and W3.

RGB colorspace matrices were taken from Here .

Any other specific code or resource used in this library is attributed in respective function or method where it is used. It can be accessible from our online documentation as well.

License

This library and its code is released under MIT License . Read full statement here.

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