Skip to content

Commit f7cf2fb

Browse files
committed
Clean up Console dtypes.
1 parent e79ee64 commit f7cf2fb

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

tcod/console.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,18 @@ def _fmt(string: str) -> bytes:
2424

2525
_root_console = None
2626

27-
rgba_graphic = np.dtype([("ch", np.intc), ("fg", "4u1"), ("bg", "4u1")])
28-
"""A NumPy :any:`dtype` compatible with :any:`Console.buffer`.
27+
rgba_graphic = np.dtype([("ch", np.intc), ("fg", "4B"), ("bg", "4B")])
28+
"""A NumPy :any:`dtype` compatible with :any:`Console.rgba`.
29+
30+
This dtype is: ``np.dtype([("ch", np.intc), ("fg", "4B"), ("bg", "4B")])``
2931
3032
.. versionadded:: 12.3
3133
"""
3234

33-
rgb_graphic = np.dtype([("ch", np.intc), ("fg", "3u1"), ("bg", "3u1")])
34-
"""A NumPy :any:`dtype` compatible with :any:`Console.tiles_rgb`.
35+
rgb_graphic = np.dtype([("ch", np.intc), ("fg", "3B"), ("bg", "3B")])
36+
"""A NumPy :any:`dtype` compatible with :any:`Console.rgb`.
37+
38+
This dtype is: ``np.dtype([("ch", np.intc), ("fg", "3B"), ("bg", "3B")])``
3539
3640
.. versionadded:: 12.3
3741
"""
@@ -93,9 +97,9 @@ class Console:
9397
Added an alpha channel to the color types.
9498
"""
9599

96-
DTYPE = np.dtype([("ch", np.intc), ("fg", "4u1"), ("bg", "4u1")])
100+
DTYPE = rgba_graphic
97101

98-
# A structured arrays type with the added "fg_rgb" and "bg_rgb" fields.
102+
# A structured array type with the added "fg_rgb" and "bg_rgb" fields.
99103
_DTYPE_RGB = np.dtype(
100104
{
101105
"names": ["ch", "fg", "bg"],
@@ -318,8 +322,8 @@ def rgb(self) -> "np.ndarray[Any, Any]":
318322
The axes of this array is affected by the `order` parameter given to
319323
initialize the console.
320324
321-
The :any:`rgb_graphic` can be used to make arrays similar to these
322-
independent of a :any:`Console`.
325+
The :any:`rgb_graphic` dtype can be used to make arrays compatiable
326+
with this attribute that are independent of a :any:`Console`.
323327
324328
Example:
325329
>>> con = tcod.console.Console(10, 2)

0 commit comments

Comments
 (0)