Skip to content

Commit 56ba61a

Browse files
committed
documentation improvements
1 parent 771113e commit 56ba61a

File tree

6 files changed

+89
-34
lines changed

6 files changed

+89
-34
lines changed

manim/utils/color/AS2700.py

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
1-
# from https://www.w3schools.com/colors/colors_australia.asp
2-
"""
3-
Australian Color Standard
1+
"""Australian Color Standard
2+
3+
In 1985 the Australian Independent Color Standard AS 2700 was created. In
4+
this standard, all colors can be identified via a category code (one of
5+
B -- Blue, G -- Green, N -- Neutrals (grey), P -- Purple, R -- Red, T -- Blue/Green,
6+
X -- Yellow/Red, Y -- Yellow) and a number. The colors also have (natural) names.
7+
8+
To use the colors from this list, access them directly from the module (which
9+
is exposed to Manim's global name space):
410
5-
Before 1985, Australians used the British color standard BS 381C.
11+
.. code:: pycon
612
7-
In 1985 the Australian Independent Colour Standard AS 2700 was created:
8-
Code Color
9-
B Blue
10-
G Green
11-
N Neutrals (grey)
12-
P Purple
13-
R Red
14-
T Blue/Green
15-
X Yellow/Red
16-
Y Yellow
13+
>>> from manim import AS2700
14+
>>> AS2700.B23_BRIGHT_BLUE
15+
ManimColor('#174F90')
1716
18-
The codes (or names) cannot be used in HTML.
17+
List of Color Constants
18+
-----------------------
1919
20-
These hex values are non official approximate values intended to simulate AS 2700 colors:
20+
These hex values (taken from `https://www.w3schools.com/colors/colors_australia.asp`__)
21+
are non official approximate values intended to simulate AS 2700 colors:
2122
2223
.. automanimcolormodule:: manim.utils.color.AS2700
2324

manim/utils/color/BS381.py

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,25 @@
1-
# from https://www.w3schools.com/colors/colors_british.asp
2-
"""
3-
The British Standards for colors is called BS 381.
1+
"""British Color Standard
2+
3+
This module contains colors defined in one of the British Standards
4+
for colors, BS381C. This standard specifies colors used in identification,
5+
coding, and other special purposes. See `https://www.britishstandardcolour.com/`__
6+
for more information.
7+
8+
To use the colors from this list, access them directly from the module (which
9+
is exposed to Manim's global name space):
10+
11+
.. code:: pycon
12+
13+
>>> from manim import BS381
14+
>>> BS381.OXFORD_BLUE
15+
ManimColor('#1F3057')
16+
17+
List of Color Constants
18+
-----------------------
419
5-
These hex values are non official approximate values intended to simulate the BS 381:
20+
These hex values (taken from `https://www.w3schools.com/colors/colors_british.asp`__)
21+
are non official approximate values intended to simulate the ones defined
22+
in the standard:
623
724
.. automanimcolormodule:: manim.utils.color.BS381
825

manim/utils/color/X11.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,24 @@
11
# from https://www.w3schools.com/colors/colors_x11.asp
22

3-
"""
4-
This list of X11 color names was developed at the
3+
"""X11 Colors
4+
5+
These color and their names (taken from
6+
`https://www.w3schools.com/colors/colors_x11.asp`__) were developed at the
57
Massachusetts Intitute of Technology (MIT) during
6-
the development of color based computer display system:
8+
the development of color based computer display system.
9+
10+
To use the colors from this list, access them directly from the module (which
11+
is exposed to Manim's global name space):
12+
13+
.. code:: pycon
14+
15+
>>> from manim import X11
16+
>>> X11.BEIGE
17+
ManimColor('#F5F5DC')
18+
19+
20+
List of Color Constants
21+
-----------------------
722
823
.. automanimcolormodule:: manim.utils.color.X11
924
"""

manim/utils/color/XKCD.py

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,24 @@
1-
# from https://www.w3schools.com/colors/colors_xkcd.asp
2-
"""
3-
XKCD Color Names
1+
"""Colors from the XKCD Color Name Survey
2+
3+
XKCD is a popular `web comic <https://xkcd.com/353/>`__ created by Randall Munroe.
4+
His "`Color Name Survey <http://blog.xkcd.com/2010/05/03/color-survey-results/>`__" (with
5+
200000 participants) resulted in a list of nearly 1000 color names.
6+
7+
While the ``XKCD`` module is exposed to Manim's global name space, the colors included
8+
in it are not. This means that in order to use the colors, access them via the module name:
9+
10+
.. code:: pycon
11+
12+
>>> from manim import XKCD
13+
>>> XKCD.MANGO
14+
ManimColor('#FFA62B')
15+
16+
17+
List of Color Constants
18+
-----------------------
419
5-
XKCD is a popular web comic created by Randall Munroe.
6-
His "Color Name Survey" (with 200 000 participants) resulted in a list of nearly 1000 color names.
7-
These hex values are non official approximate values intended to simulate the colors in HTML:
20+
These hex values are non official approximate values intended to simulate the colors in HTML,
21+
taken from `https://www.w3schools.com/colors/colors_xkcd.asp`__.
822
923
.. automanimcolormodule:: manim.utils.color.XKCD
1024

manim/utils/color/__init__.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,23 @@
1717
- The colors listed in :mod:`.color.manim_colors` are loaded into
1818
Manim's global name space.
1919
- The colors in :mod:`.color.AS2700`, :mod:`.color.BS381`, :mod:`.color.X11`,
20-
and :mod:`.color.XKCD` need to be imported separately, or referred to via
21-
their module names. For example:
20+
and :mod:`.color.XKCD` need to be accessed via their module (which are available
21+
in Manim's global name space), or imported separately. For example:
2222
2323
.. code:: pycon
2424
2525
>>> from manim import XKCD
2626
>>> XKCD.AVOCADO
2727
ManimColor('#90B134')
2828
29+
Or, alternatively:
30+
31+
.. code:: pycon
32+
33+
>>> from manim.utils.color.XKCD import AVOCADO
34+
>>> AVOCADO
35+
ManimColor('#90B134')
36+
2937
The following modules contain the predefined color constants:
3038
3139
.. autosummary::

manim/utils/color/core.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
"""Manim's (internal) color class and some utilities for color conversion.
1+
"""Manim's (internal) color data structure and some utilities for
2+
color conversion.
23
34
This module contains the implementation of :class:`.ManimColor`,
4-
the class internally used to represent colors.
5-
5+
the data structure internally used to represent colors.
66
"""
77

88

0 commit comments

Comments
 (0)