+///////////////////////////////////////////////////////////////////////
+class InsetColoredCell : public InsetMathNest {
+public:
+ ///
+ InsetColoredCell(Buffer * buf, ColorCode min, ColorCode max);
+ ///
+ InsetColoredCell(Buffer * buf, ColorCode min, ColorCode max, MathAtom const & atom);
+ ///
+ void draw(PainterInfo &, int x, int y) const;
+ ///
+ void metrics(MetricsInfo & mi, Dimension & dim) const;
+
+protected:
+ ///
+ Inset * clone() const;
+ ///
+ ColorCode min_;
+ ///
+ ColorCode max_;
+};
+
+
+InsetColoredCell::InsetColoredCell(Buffer * buf, ColorCode min, ColorCode max)
+ : InsetMathNest(buf, 1), min_(min), max_(max)
+{
+}
+
+
+InsetColoredCell::InsetColoredCell(Buffer * buf, ColorCode min, ColorCode max, MathAtom const & atom)
+ : InsetMathNest(buf, 1), min_(min), max_(max)
+{
+ cell(0).insert(0, atom);
+}
+
+
+Inset * InsetColoredCell::clone() const
+{
+ return new InsetColoredCell(*this);
+}
+
+
+void InsetColoredCell::metrics(MetricsInfo & mi, Dimension & dim) const
+{
+ cell(0).metrics(mi, dim);
+}
+
+
+void InsetColoredCell::draw(PainterInfo & pi, int x, int y) const
+{
+ pi.pain.enterMonochromeMode(min_, max_);
+ cell(0).draw(pi, x, y);
+ pi.pain.leaveMonochromeMode();
+}
+
+