Socket
Socket
Sign inDemoInstall

colorteller

Package Overview
Dependencies
9
Maintainers
1
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    colorteller

colorteller, benchmarking color palattes.


Maintainers
1

Readme

colorteller

Test Code with Pip

Benchmark color palettes.

pip install colorteller

We have a website!

We have built a website for color palette discovery and sharing:

https://colorteller.kausalflow.com

Documentation

Read the Documentation.

Use the Command Line Tool

colorteller benchmark -h "#8de4d3" -h "#344b46" -h "#74ee65" -h "#238910" -h "#a6c363" -h "#509d99" -wbc True -t test_colorteller_cmd
  • -h specifies a color in hex format;
  • -t specifies the folder to hold all the results (charts, metrics json, etc). It should be a folder.;
  • -wbc is True will create benchmark metric charts;

Use in Python Code

Create a ColorTeller Object

from colorteller.teller import ColorTeller

hex_strings = ["#8de4d3", "#344b46", "#74ee65", "#238910", "#a6c363", "#509d99"]

ct = teller.ColorTeller(hex_strings=hex_strings)

To retrieve the properties of the color palette, please refer to colorteller.teller.

Create Benchmarks

from colorteller.teller import ColorTeller
from colorteller.utils import benchmark

hex_strings = ["#8de4d3", "#344b46", "#74ee65", "#238910", "#a6c363", "#509d99"]

ct = teller.ColorTeller(hex_strings=hex_strings)
c = teller.Colors(colorteller=ct)

m = c.metrics(
    methods=[
        benchmark.PerceptualDistanceBenchmark,
        benchmark.LightnessBenchmark
    ]
)

Visualizations

Metric Visualizations
from colorteller import teller
from colorteller.utils import benchmark
from colorteller.visualize import BenchmarkCharts, ApplicationCharts

hex_strings = ["#8de4d3", "#344b46", "#74ee65", "#238910", "#a6c363", "#509d99"]

ct = teller.ColorTeller(hex_strings=hex_strings)

c = teller.Colors(colorteller=ct)

m = c.metrics(
    methods=[benchmark.PerceptualDistanceBenchmark, benchmark.LightnessBenchmark]
)

charts = BenchmarkCharts(metrics=m, save_folder=".")

charts.distance_matrix(show=True)
charts.noticable_matrix(show=True)
Demo Figures Using the Color Palette
from colorteller import teller
from colorteller.utils import benchmark
from colorteller.visualize import BenchmarkCharts, ApplicationCharts

hex_strings = ["#8de4d3", "#344b46", "#74ee65", "#238910", "#a6c363", "#509d99"]

ct = teller.ColorTeller(hex_strings=hex_strings)

c = teller.Colors(colorteller=ct)

ac = ApplicationCharts(colors=c, save_folder=".")

ac.charts(save_to=True)

# One could also create specific charts using the following
# ac.bar_chart(show=True)
# ac.line_chart(show=True)
# ac.scatter_chart(show=True)
# ac.donut_chart(show=True)

FAQs


Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc