Add network function get_ip docstring

This commit is contained in:
2023-03-10 22:19:19 -06:00
parent de2a6154b8
commit a8ea9865ca

View File

@@ -9,6 +9,15 @@ maximum_chunk = (2 ** 16) - 1
def get_ip(x: int, y: int, rgb: Tuple[int, int, int], large: bool = False):
"""
Build the destination IP address given the constants. Arguments are not tested for validity.
:param x: The X coordinate as an integer. [0, 512]
:param y: The Y coordinate as an integer. [0, 512]
:param rgb: The RGB of each pixel described by a tuple of integers. [0, 255]
:param large: If true, will place 2x2 pixels instead. Defaults to False.
:return: The IPv6 address as a string.
"""
return f"2a06:a003:d040:{'2' if large else '1'}{x:03X}:{y:03X}:{rgb[0]:02X}:{rgb[1]:02X}:{rgb[2]:02X}"