Connection
Base URL, credentials and a reachable server.
Decode a color written as a hash followed by exactly six ASCII hexadecimal digits into three channel integers.
Base URL, credentials and a reachable server.
A model available through the configured endpoint.
Context limits and tool support are determined by the model and server.
def rgb_hex(text):
digits = "0123456789abcdefABCDEF"
if not isinstance(text, str) or len(text) != 7 or text[0] != "#":
raise ValueError("color.format")
if any(char not in digits for char in text[1:]):
raise ValueError("color.digit")
return tuple(int(text[i:i + 2], 16) for i in (1, 3, 5))