color_tools.mcp.server
MCP server exposing Color Tools color science and filament expertise.
- color_tools.mcp.server.analyze_color(red, green, blue, named_color_count=3, filament_count=5)[source]
Analyze an sRGB color in all spaces and find named-color and filament matches.
- Return type:
- Parameters:
red (Annotated[int, FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=0), Le(le=255)])])
green (Annotated[int, FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=0), Le(le=255)])])
blue (Annotated[int, FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=0), Le(le=255)])])
named_color_count (Annotated[int, FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=1), Le(le=50)])])
filament_count (Annotated[int, FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=1), Le(le=50)])])
- color_tools.mcp.server.compare_colors(first_red, first_green, first_blue, second_red, second_green, second_blue)[source]
Compare two sRGB colors with every Color Tools perceptual distance metric.
- Return type:
- Parameters:
first_red (Annotated[int, FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=0), Le(le=255)])])
first_green (Annotated[int, FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=0), Le(le=255)])])
first_blue (Annotated[int, FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=0), Le(le=255)])])
second_red (Annotated[int, FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=0), Le(le=255)])])
second_green (Annotated[int, FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=0), Le(le=255)])])
second_blue (Annotated[int, FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=0), Le(le=255)])])
- color_tools.mcp.server.convert_color(source_space, target_space, component_1, component_2, component_3, component_4=None, clamp_rgb=True)[source]
Convert scalar components between RGB, XYZ, LAB, LCH, HSL, CMY, and CMYK using D65 sRGB.
- color_tools.mcp.server.find_filaments(red, green, blue, metric='de2000', count=5, makers=None, materials=None, finishes=None, owned_only=False, max_hue_delta=None)[source]
Find filament colors; maker, material, and finish filters accept comma-separated values.
- Return type:
- Parameters:
red (Annotated[int, FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=0), Le(le=255)])])
green (Annotated[int, FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=0), Le(le=255)])])
blue (Annotated[int, FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=0), Le(le=255)])])
metric (Literal['de2000', 'de94', 'de76', 'cmc', 'hyab'])
count (Annotated[int, FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=1), Le(le=50)])])
makers (str | None)
materials (str | None)
finishes (str | None)
owned_only (bool)
max_hue_delta (Annotated[float | None, FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=0.0), Le(le=180.0)])])
- color_tools.mcp.server.find_named_colors(red, green, blue, palette='css', metric='de2000', count=5)[source]
Find nearest named colors in the CSS database or a bundled retro palette.
- Return type:
- Parameters:
red (Annotated[int, FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=0), Le(le=255)])])
green (Annotated[int, FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=0), Le(le=255)])])
blue (Annotated[int, FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=0), Le(le=255)])])
palette (str)
metric (Literal['de2000', 'de94', 'de76', 'cmc', 'hyab'])
count (Annotated[int, FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=1), Le(le=50)])])
- color_tools.mcp.server.get_filament_catalog()[source]
List valid makers, materials, and finishes for filtering filament searches.
- Return type:
- color_tools.mcp.server.map_to_srgb_gamut(lightness, a, b)[source]
Check a LAB color and map it into sRGB by preserving lightness and hue while reducing chroma.
- Return type:
- Parameters:
- color_tools.mcp.server.transform_color_vision(red, green, blue, deficiency, operation='simulate')[source]
Simulate a color vision deficiency or apply a discriminability correction.
- Return type:
- Parameters:
red (Annotated[int, FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=0), Le(le=255)])])
green (Annotated[int, FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=0), Le(le=255)])])
blue (Annotated[int, FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=0), Le(le=255)])])
deficiency (Literal['protanopia', 'protan', 'deuteranopia', 'deutan', 'tritanopia', 'tritan', 'all'])
operation (Literal['simulate', 'correct'])