+// This function returns a string representation of a floating point number in
+// C locale (i.e. always using "." for the decimal separator) and with the
+// fixed precision (which is 2 for some unknown reason but this is what it was
+// in this code originally).
+inline wxString NumStr(double f)
+{
+ return wxString::FromCDouble(f, 2);
+}
+
+// Return the colour representation as HTML-like "#rrggbb" string and also
+// returns its alpha as opacity number in 0..1 range.
+wxString Col2SVG(wxColour c, float *opacity)
+{
+ if ( c.Alpha() != wxALPHA_OPAQUE )
+ {
+ *opacity = c.Alpha()/255.;
+
+ // Remove the alpha before using GetAsString(wxC2S_HTML_SYNTAX) as it
+ // doesn't support colours with alpha channel.
+ c = wxColour(c.GetRGB());
+ }
+ else // No alpha.
+ {
+ *opacity = 1.;
+ }
+
+ return c.GetAsString(wxC2S_HTML_SYNTAX);
+}
+
+wxString wxPenString(wxColour c, int style = wxPENSTYLE_SOLID)