+//////////
+// archiving
+//////////
+
+/** Construct object from archive_node. */
+color::color(const archive_node &n, const lst &sym_lst) : inherited(n, sym_lst)
+{
+ debugmsg("color constructor from archive_node", LOGLEVEL_CONSTRUCT);
+ unsigned int ty;
+ if (!(n.find_unsigned("type", ty)))
+ throw (std::runtime_error("unknown color type in archive"));
+ type = (color_types)ty;
+ if (!(n.find_unsigned("representation", representation_label)))
+ throw (std::runtime_error("unknown color representation label in archive"));
+}
+
+/** Unarchive the object. */
+ex color::unarchive(const archive_node &n, const lst &sym_lst)
+{
+ return (new color(n, sym_lst))->setflag(status_flags::dynallocated);
+}
+
+/** Archive the object. */
+void color::archive(archive_node &n) const
+{
+ inherited::archive(n);
+ n.add_unsigned("type", type);
+ n.add_unsigned("representation", representation_label);
+}
+