--- /dev/null
+#include <msp/strings/format.h>
+#include "effectcolor.h"
+
+using namespace std;
+using namespace Msp;
+
+void operator>>(const LexicalConverter &conv, EffectColor &color)
+{
+ const string &str = conv.get();
+ if(str=="White")
+ color = WHITE;
+ else if(str=="Red")
+ color = RED;
+ else if(str=="Green")
+ color = GREEN;
+ else if(str=="Blue")
+ color = BLUE;
+ else if(str=="Brown")
+ color = BROWN;
+ else if(str=="Yellow")
+ color = YELLOW;
+ else
+ throw lexical_error(format("Conversion of %s to EffectColor", str));
+}
+
+void operator<<(LexicalConverter &conv, EffectColor color)
+{
+ switch(color)
+ {
+ case WHITE: conv.result("White"); return;
+ case RED: conv.result("Red"); return;
+ case GREEN: conv.result("Green"); return;
+ case BLUE: conv.result("Blue"); return;
+ case BROWN: conv.result("Brown"); return;
+ case YELLOW: conv.result("Yellow"); return;
+ default: conv.result(format("EffectColor(%d)", static_cast<int>(color))); return;
+ }
+}