How to pass colors from xcolor in pgfplotsx?

By using the parse function, included in Colors package, and the @colorant_str macro the issue can be overcomes:

@pgf Axis(
    {
        xlabel = "Cost",
        ylabel = "Error",
    },
    Plot(
        {
            color = parse(Colorant, "NavyBlue")
            mark  = "x"
        },
        Coordinates(
            [
                (2, -2.8559703),
                (3, -3.5301677),
                (4, -4.3050655),
                (5, -5.1413136),
                (6, -6.0322865),
                (7, -6.9675052),
                (8, -7.9377747),
            ]
        ),
    ),
)