Skip to main content

A Manim plugin that lets you apply a iterm2 color theme to your Manim scenes.

Project description

PyPI version License Documentation Status

Example Themes

About this Project

This project is a Python Module that provides allows theming of Manim projects with iterm2 color themes. It works by overriding the default Manim configuration with a set of colors that are derived from the selected theme. I am not an expert in how Python looks up variables, and I am not sure if there is a better way for a plugin to realise theming. It works fine for my purposes, but if you have a idea how to improve this, feel free to let me know (by issuing a pull request or opening an issue).

Installation

Install the package with pip:

   pip install manim-themes

Minimal Example

NOTE: Please make sure you have manim installed and running on your machine

Below is a minimal example of how to use the Module.

import manim as m

from manim_themes.manim_theme import apply_theme


class MinimalThemeExample(m.Scene):

    def setup(self):
        # Set the background color to a light beige
        theme = "Andromeda"
        apply_theme(manim_scene=self, theme_name=theme, light_theme=True)

    def construct(self):
        my_text = m.Text("Hello World")
        maroon_text = m.Text("I use Manim BTW", color=m.MAROON)
        maroon_text.next_to(my_text, m.DOWN)

        text_group = m.VGroup(my_text, maroon_text).move_to(m.ORIGIN)

        self.play(m.FadeIn(text_group))


if __name__ == '__main__':
    import os
    from pathlib import Path

    FLAGS = "-pqm"
    SCENE = "MinimalThemeExample"

    file_path = Path(__file__).resolve()
    os.system(f"manim {Path(__file__).resolve()} {SCENE} {FLAGS}")

This should yield a Scene that looks like so:

Example Output Screenshot

Documentation

This project uses sphinx for generating the documentation. It also uses a lot of sphinx extensions to make the documentation more readable and interactive. For example the extension myst-parser is used to enable markdown support in the documentation (instead of the usual .rst-files). It also uses the sphinx-autobuild extension to automatically rebuild the documentation when changes are made. By running the following command, the documentation will be automatically built and served, when changes are made (make sure to run this command in the root directory of the project):

sphinx-autobuild ./docs/source/ ./docs/build/html/

If sphinx extensions were added the requirements_dev.txt file needs to be updated. These are the requirements, that readthedocs uses to build the documentation. The file can be updated using this command:

poetry export -f requirements.txt --output requirements.txt --with dev

This project features most of the extensions featured in this Tutorial: Document Your Scientific Project With Markdown, Sphinx, and Read the Docs | PyData Global 2021.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

manim_themes-0.1.1.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

manim_themes-0.1.1-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file manim_themes-0.1.1.tar.gz.

File metadata

  • Download URL: manim_themes-0.1.1.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for manim_themes-0.1.1.tar.gz
Algorithm Hash digest
SHA256 084aff011098c83ea96722101640995ec3f2d6c2f98754dac58dfb7cbd0298ce
MD5 cb75cb73fdc809fc5a8327dc842f4cd4
BLAKE2b-256 6796723473e1e3c3dc7de018cd0302ed2eeff9c913a45d4bdc17be86606c4657

See more details on using hashes here.

File details

Details for the file manim_themes-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: manim_themes-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 12.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for manim_themes-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6dd7e2c782d60cbfa01fc17bee2b14fce1ae024bf3b96e1405994fb9b2c3912d
MD5 960555c7d3c122c7020a5c113f43601e
BLAKE2b-256 f63a15ab1782150c1079197783fc06146d28be2129cb1bd827399b46ec22227b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page