def set_neopixel(pixel_index=None, color=None):
    """Set one or more neopixels to a specific color.
    
    Args:
        pixel_index (int, list, tuple, or None): Single index (0-4), list/tuple of indices, or None for all pixels
        color (int or str): RGB color value in hexadecimal format (e.g., 0xFF0000) 
                           or color name from COLORS dictionary (e.g., 'red', 'blue')
    
    Example usage:
        set_neopixel()                      # Set all pixels to black (off) - no index or color specified
        set_neopixel(color='red')           # Set all pixels to red (no index specified - defaults to all)
        set_neopixel([0, 1, 2, 3, 4], 'green') # Set all pixels to green - indexes each individually
        set_neopixel(0, 'red')              # Set pixel 0 to red
        set_neopixel([0, 2], 'magenta')     # Set pixels 0 and 2 to magenta - input is a list
        set_neopixel((1, 3, 4), 'blue')     # Set pixels 1, 3, and 4 to blue - input is a tuple
        set_neopixel(4, 0x0000FF)            # Set pixel 4 to blue using hex value
    """
    # If no index is provided, set all pixels (0-4)
    if pixel_index is None:
        indices = [0, 1, 2, 3, 4]
    # Convert single index to list for uniform processing
    elif isinstance(pixel_index, int):
        indices = [pixel_index]
    elif isinstance(pixel_index, (list, tuple)):
        indices = list(pixel_index)
    else:
        print("Error: pixel_index must be an integer, list, tuple, or None.")
        return
    
    # Validate all indices are in range
    for idx in indices:
        if not (0 <= idx <= 4):
            print(f"Error: Pixel index {idx} is out of range. Valid range is 0-4.")
            return
    
    # Default to black (off) if no color is specified
    if color is None:
        color_value = 0x000000
    # Convert color name to hex value if needed
    elif isinstance(color, str):
        if color.lower() in COLORS:
            color_value = COLORS[color.lower()]
        else:
            print(f"Error: Color '{color}' not found. Available colors: {list(COLORS.keys())}")
            return
    else:
        # Assume it's already a hex value
        color_value = color
    
    # Set all specified pixels to the color
    for idx in indices:
        jam.neopixels[idx] = color_value
    
    # Update display once after all changes
    jam.neopixels.show()