def get_arrow_surf(foreground_color, height):
    """Return arrow surface w/ given color and height.

    If an arrow for the given arguments doesn't exist
    already, it is created and stored on the spot,
    before being returned.

    Parameters
    ==========
    foreground_color (sequence of integers)
        represents the color of the arrow; the integers
        are in range(256) and represent values of red,
        green and blue channels of the color, respectively.
    height (integer)
        height of the arrow surface; the arrow itself
        won't have this height; such height will be
        achieved by the arrow itself plus some extra
        padding added so the arrow appears in the very
        center of the surface with some pleasing padding
        around it.
    """
    ### create a custom-formatted tuple from the received
    ### foreground color and height, to use as a key

    key = tuple(map(str, (foreground_color, height)))

    ### try retrieving a reference to the arrow surf from
    ### a special dict dedicated to store them
    try:
        arrow_surf = STYLE_TO_ARROW_SURFS[key]

    ### if such arrow doesn't exist, we create and store it,
    ### in the dictionary, and also reference it locally

    except KeyError:

        arrow_surf = STYLE_TO_ARROW_SURFS[key] = render_layered_icon(
            chars=[chr(82)],
            colors=[foreground_color],
            dimension_name="height",
            dimension_value=height - 8,
            padding=4,
            background_height=height,
            flip_y=True,
        )

    ### we then return the arrow
    return arrow_surf
Return arrow surface w/ given color and height.

    If an arrow for the given arguments doesn't exist
    already, it is created and stored on the spot,
    before being returned.

    Parameters
    ==========
    foreground_color (sequence of integers)
        represents the color of the arrow; the integers
        are in range(256) and represent values of red,
        green and blue channels of the color, respectively.
    height (integer)
        height of the arrow surface; the arrow itself
        won't have this height; such height will be
        achieved by the arrow itself plus some extra
        padding added so the arrow appears in the very
        center of the surface with some pleasing padding
        around it.
    
nodezator/widget/optionmenu/creation.py