+wxString wxPenString(wxColour c, int style = wxPENSTYLE_SOLID)
+{
+ wxString s = wxT("stroke:") + c.GetAsString(wxC2S_HTML_SYNTAX) + wxT("; ");
+ // Use the color's alpha value (if not opaque) for the opacity.
+ // Note that a transparent pen will override the alpha value.
+ if (c.Alpha() != wxALPHA_OPAQUE && style != wxPENSTYLE_TRANSPARENT)
+ {
+ s += wxString::Format(wxT("stroke-opacity:%s; "), NumStr(c.Alpha()/255.));
+ }
+ else
+ {
+ switch ( style )
+ {
+ case wxPENSTYLE_SOLID:
+ s += wxT("stroke-opacity:1.0; ");
+ break;
+ case wxPENSTYLE_TRANSPARENT:
+ s += wxT("stroke-opacity:0.0; ");
+ break;
+ default :
+ wxASSERT_MSG(false, wxT("wxSVGFileDC::Requested Pen Style not available"));
+ }
+ }