Skip to content

Improve and simplify Manim's color handling #2451

@Darylgolden

Description

@Darylgolden

Enhancement proposal

  • Manim's colors are defined twice, once in an enum and once as constants. It seems like the Enum was introduced in # New colour enums- Try2 #488 as an attempt to clean up the code, with constants having to be explicitly imported. However, for convenience the community eventually decided to import all the constants, and then to appease people's editors and linters the constants eventually had to be explicitly defined as well. I think we should either only define colors in an enum, or define them as constants, but not both. Seeing how the natural trend is to go towards convenience, I think they should be defined as constants. Furthermore, they should be instances of the Color class from the colour module (or @marcin-serwin's fork).
  • We have many functions for converting between color representations that duplicate the functionality of existing, specialized libraries. Any uses of those should be replaced, probably by methods of Color, and the functions eventually removed.

Additional comments

Metadata

Metadata

Labels

enhancementAdditions and improvements in general

Type

No type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions