@@ -23,6 +23,17 @@ def _fmt(string: str) -> bytes:
2323
2424_root_console = None
2525
26+ rgba_graphic = np .dtype ([("ch" , np .intc ), ("fg" , "4u1" ), ("bg" , "4u1" )])
27+ """A NumPy :any:`dtype` compatible with :any:`Console.buffer`.
28+
29+ .. versionadded:: 12.3
30+ """
31+
32+ rgb_graphic = np .dtype ([("ch" , np .intc ), ("fg" , "3u1" ), ("bg" , "3u1" )])
33+ """A NumPy :any:`dtype` compatible with :any:`Console.tiles_rgb`.
34+
35+ .. versionadded:: 12.3
36+ """
2637
2738class Console :
2839 """A console object containing a grid of characters with
@@ -77,13 +88,13 @@ class Console:
7788 Added an alpha channel to the color types.
7889 """
7990
80- DTYPE = np .dtype ([("ch" , np .intc ), ("fg" , "(4,)u1 " ), ("bg" , "(4,)u1 " )])
91+ DTYPE = np .dtype ([("ch" , np .intc ), ("fg" , "4u1 " ), ("bg" , "4u1 " )])
8192
8293 # A structured arrays type with the added "fg_rgb" and "bg_rgb" fields.
8394 _DTYPE_RGB = np .dtype (
8495 {
8596 "names" : ["ch" , "fg" , "bg" ],
86- "formats" : [np .int32 , "(3,)u1 " , "(3,)u1 " ],
97+ "formats" : [np .int32 , "3u1 " , "3u1 " ],
8798 "offsets" : [0 , 4 , 8 ],
8899 "itemsize" : 12 ,
89100 }
0 commit comments