0
Options[f]={"a"->Red}
(* {a -> Red} *)

f[Name][x_,options:OptionsPattern[]] :=
  Block[{},
    Plot[x, {x,0,10}, PlotStyle -> OptionValue[f,"a"]];
    OptionValue[f, "a"]
  ]

f[Name][x,"a"->Black]

The OptionValue of is always Red

Sols:

Options[f]={"a"->Red}; 
f[Name][x_,opts:OptionsPattern[f]]:=Plot[x,{x,0,10},PlotStyl‌​e->OptionValue[f,{op‌​ts},"a"]] 
f[Name][x,"a"->Black]
HyperGroups
  • 8,619
  • 1
  • 26
  • 63

0 Answers0