def apply_visual_color(
    geom: trimesh.Trimesh,
    visual: Visual,
    material_map: Dict[str, Material],
) -> None:
    """Apply the color of the visual material to the mesh.

    Args:
        geom: Trimesh to color.
        visual: Visual description from XML.
        material_map: Dictionary mapping material names to their definitions.
    """
    if visual.material is None:
        return

    if visual.material.color is not None:
        color = visual.material.color
    elif visual.material.name is not None and visual.material.name in material_map:
        color = material_map[visual.material.name].color
    else:
        return

    if color is None:
        return
    if isinstance(geom.visual, trimesh.visual.ColorVisuals):
        geom.visual.face_colors[:] = [int(255 * channel) for channel in color.rgba]
Apply the color of the visual material to the mesh.

    Args:
        geom: Trimesh to color.
        visual: Visual description from XML.
        material_map: Dictionary mapping material names to their definitions.
    
deploy/teleop/robot_control/dex_retargeting/yourdfpy.py