|
27 | 27 | [0.24613297, 0.3678193 , 0.6222316 , 0.8195127 , 0.79614234], |
28 | 28 | [0.17527187, 0.4373501 , 0.76734173, 0.9020113 , 0.76327705]], |
29 | 29 | dtype=float32) |
30 | | -
|
31 | | -
|
| 30 | + >>> ((samples + 1.0) * (256 / 2)).astype(np.uint8) # Or as 8-bit unsigned bytes. |
| 31 | + array([[128, 57, 30, 37, 40], |
| 32 | + [ 92, 35, 33, 71, 90], |
| 33 | + [ 76, 54, 85, 144, 164], |
| 34 | + [ 63, 94, 159, 209, 203], |
| 35 | + [ 44, 111, 196, 230, 195]], dtype=uint8) |
32 | 36 | """ # noqa: E501 |
33 | 37 | import enum |
34 | 38 | import warnings |
@@ -89,7 +93,7 @@ def __repr__(self) -> str: |
89 | 93 |
|
90 | 94 |
|
91 | 95 | def __getattr__(name: str) -> Implementation: |
92 | | - if hasattr(Implementation, name): |
| 96 | + if name in Implementation.__members__: |
93 | 97 | warnings.warn( |
94 | 98 | f"'tcod.noise.{name}' is deprecated," |
95 | 99 | f" use 'tcod.noise.Implementation.{name}' instead.", |
|
0 commit comments