Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: dvipsnames and svgnames color palettes #3913

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

christopher-hampson
Copy link
Contributor

Overview: What does this pull request change?

  • Adds color palettes for DVIPSNAMES and SVGNAMES for colors commonly used in LaTeX via the xcolor package.
  • Additional color palettes are accessed in the same way as current palettes/standards already implemented. For example:
    >>> from manim import DVIPSNAMES
    >>> DVIPSNAMES.DARKORCHID
    ManimColor("#A4538A")
    >>> from manim import SVGNAMES
    >>> SVGNAMES.LIGHTCORAL
    ManimColor("##EF7F7F")

Motivation and Explanation: Why and how do your changes improve the library?

  • Provides access to colors that users may be familiar with from typsetting documents/slides in LaTeX, without users needing to lookup and define these themselves.

Links to added or changed documentation pages

Further Information and Comments

Reviewer Checklist

  • The PR title is descriptive enough for the changelog, and the PR is labeled correctly
  • If applicable: newly added non-private functions and classes have a docstring including a short summary and a PARAMETERS section
  • If applicable: newly added functions and classes are tested

Copy link
Member

@JasonGrace2282 JasonGrace2282 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good to me! Some other stuff:

Do you mind updating this part of the docs?
https://manimce--3913.org.readthedocs.build/en/3913/reference/manim.utils.color.html
image

"""DVIPSNAMES Colors

This module contains colors defined in the DVIPS driver and are commonly accessed
as named colors in LaTeX via the `\\usepackage[dvipsnames]{xcolor}` package.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Single backticks are italics in sphinx, I think inline code looks nicer ;)

Suggested change
as named colors in LaTeX via the `\\usepackage[dvipsnames]{xcolor}` package.
as named colors in LaTeX via the ``\\usepackage[dvipsnames]{xcolor}`` package.

You also might want to use a raw docstring - add an r to the beginning of """, and then you can get rid of the double \\

"""SVGNAMES Colors

This module contains colors defined in the SVG 1.1 specification and are commonly
accessed as named colors in LaTeX via the `\\usepackage[svgnames]{xcolor}` package.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

Suggested change
accessed as named colors in LaTeX via the `\\usepackage[svgnames]{xcolor}` package.
accessed as named colors in LaTeX via the ``\\usepackage[svgnames]{xcolor}`` package.

@JasonGrace2282 JasonGrace2282 added the enhancement Additions and improvements in general label Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Additions and improvements in general
Projects
Status: 👀 In review
Development

Successfully merging this pull request may close these issues.

2 participants