pub fn extract_style_and_file_arg(
args: &[Value],
) -> Result<(Vec<Value>, Option<StyleSpec>, Option<String>), String>Expand description
Splits off an optional trailing style and/or file-path argument from args.
Processing order (first match wins):
- Trailing
'color', <value>named-argument pair. - Trailing 1×3 RGB matrix (values in
[0, 1]) — only when the number of remaining data args would exceedmin_dataafter stripping. - Trailing MATLAB-style format string (
"r--","red","#FF4400", …). - Trailing file path (
.svg,.png, or"ascii").
min_data sets the minimum number of data arguments that must remain after
removing the style element. Pass 1 for most callers; pass a higher value
(e.g. 4 for quiver) to prevent ambiguous vector data from being consumed
as an RGB colour spec.
Returns (data_args, style, path).