This example shows you how to modify the style of each drawable elements. You just have to create an instance of CustomColors, CustomPenColor, CustomFillColor or CustomPen and you attach this style to your drawable element type with an instance of CustomStyle outputed in the Board2D stream.
#include <iostream>
#include "DGtal/base/Common.h"
#include "DGtal/io/boards/Board2D.h"
#include "DGtal/helpers/StdDefs.h"
#include "DGtal/io/Color.h"
using namespace std;
using namespace DGtal;
using namespace DGtal::Z2i;
int main()
{
Color dgreen( 0, 192, 0 );
Color dblue( 0, 0, 192 );
board << domain
<< p1
<< p2
Board2D::Shape::SolidStyle,
Board2D::Shape::RoundCap,
Board2D::Shape::RoundJoin ) )
<< p3;
board.
saveSVG(
"dgtalBoard2D-3-custom-classes.svg");
board.
saveEPS(
"dgtalBoard2D-3-custom-classes.eps");
board.
saveTikZ(
"dgtalBoard2D-3-custom-classes.tikz");
#ifdef WITH_CAIRO
board.saveCairo("dgtalBoard2D-3-custom-classes-cairo.pdf", Board2D::CairoPDF);
board.saveCairo("dgtalBoard2D-3-custom-classes-cairo.png", Board2D::CairoPNG);
board.saveCairo("dgtalBoard2D-3-custom-classes-cairo.ps", Board2D::CairoPS);
board.saveCairo("dgtalBoard2D-3-custom-classes-cairo.svg", Board2D::CairoSVG);
#endif
return 0;
}