Skip to content

[colorManipulator][docs] Document the color helpers #13039

Open
@petermikitsh

Description

@petermikitsh
  • This is not a v0.x issue.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

I've done a comparison of various JS color utility libraries. I found that @material-ui/core/es/styles/colorManipulator.js offers the smallest bundle size of all options I could find. Here's a comparison to other libraries (all numbers are minified; second number is minified + gzipped):

  • colorManipulator.js // 3.02kb, 1.25 gzipped
  • kewler // 7.24kb, 2.7kb gzipped
  • spectra // 10.5kb, 3.38kb gzipped
  • tinycolor2 // 15.2kb, 5.28kb gzipped
  • color // 23.1kb, 7.83kb gzipped
  • chroma-js // 39.8, 15.9kb gzipped

Current Behavior

@oliviertassinari has stated that the color manipulator is a private API. He also openly asked if there were better open-source alternatives to the private implementation. In my view, there is no better alternative. colorManipulator.js offers basically identical functionality to all of the other libraries, and does it in the fewest amount of bytes.

Context

Color Manipulation is a very generic problem, this library has the best solution, but it is a private API. I think it could be easily publishable as a separate entity within the mono-repo structure. It's already fully unit tested, so there could be no disagreement that it would be in a good state to make publicly accessible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsImprovements or additions to the documentationnew featureNew feature or requestpackage: systemSpecific to @mui/system

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions