Giter Site home page Giter Site logo

evercoder / culori Goto Github PK

View Code? Open in Web Editor NEW
800.0 800.0 30.0 5.91 MB

A comprehensive color library for JavaScript.

Home Page: https://culorijs.org

License: MIT License

JavaScript 96.76% HTML 2.83% Shell 0.01% Python 0.39%
cielab cielch color color-difference css-color din99 hsl hsv hwb ictcp interpolation jzazbz lab oklab rgb

culori's People

Contributors

akx avatar azat-io avatar bijela-gora avatar danburzo avatar dependabot[bot] avatar devgru avatar felixgirault avatar meodai avatar prjctimg avatar rozaxe avatar siddharth11 avatar vojtechvidra avatar vrzlev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

culori's Issues

Should `flags` be enumerable?

Arguments for enumerable

  • Extending a color with { ...color } maintains the flags.

Arguments against enumerable

  • Cleaner output in the console and tests. (although tests will need to check the flags separately, for better coverage)
  • May be that extending a color with { ...color } will result in inaccurate flags.

css4()

Like css but outputs to the formats defined in Color Module Level 4.

interpolate()

interpolate(color_array, mode = 'rgb') returns an interpolator function that takes an argument [0, 1].

HWB

  • css hwb parser
  • hwb_to_rgb converter
  • rgb_to_hwb converter

Spline interpolation + number/hue/alpha interpolation

For linear interpolation:

  • Bring back short vs. long hue interpolation
  • Check hue normalization throughout the hue() method

For spline interpolation:

  • Add closed version
  • How to spline-interpolate alpha?
  • How to spline-interpolate short vs long hue?
  • need to check that performance was not degraded with current developments...

luminance() and contrast()

L = 0.2126 * R + 0.7152 * G + 0.0722 * B in LRGB space.

contrast = (L1 + 0.05) / (L2 + 0.05) in the WGAG spec.

Gray

  • gray css parser
  • gray_to_rgb converter
  • rgb_to_gray converter

Pick a suitable internal format

Regardless of the various formats the colors come in, they ultimately reflect a RGB(A) value, so it makes sense to keep the internal format as R, G, B, A (floating-point values): in -> RGBA -> out

However, for the purposes of color scales, one might have three colors defined:

H - 120, S, L, A
H, S, L, A
H + 120, S, L, A

In which case H could go beyond [0, 360] and we need to store the original value to properly interpolate.

LCH

  • lch css parser
  • lch_to_rgb converter
  • rgb_to_lch converter

swatches()

swatches(interpolator, no_of_colors) to generate color scales.

scale(colors, mode, no_of_colors) can be implemented as swatches(interpolate(colors, mode), no_of_colors).

Add spline interpolation

With closed and open variants, like in D3. the closed version can be useful for radial sliders for hue.

LAB

  • lab css parser
  • lab_to_rgb converter
  • rgb_to_lab converter

HSI

  • hsi_to_rgb converter
  • rgb_to_hsi converter

Cubehelix

  • cubehelix_to_rgb converter
  • rgb_to_cubehelix converter

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.