// Draw the curve
/* if(solid_lines)
{
- gc->set_rgb_fg_color(Gdk::Color("#000000"));
+ gc->set_rgb_fg_color(DUCK_COLOR_BEZIER_1);
gc->set_function(Gdk::COPY);
gc->set_line_attributes(3,Gdk::LINE_SOLID,Gdk::CAP_BUTT,Gdk::JOIN_MITER);
drawable->draw_lines(gc, Glib::ArrayHandle<Gdk::Point>(points));
- gc->set_rgb_fg_color(Gdk::Color("#afafaf"));
+ gc->set_rgb_fg_color(DUCK_COLOR_BEZIER_2);
gc->set_line_attributes(1,Gdk::LINE_SOLID,Gdk::CAP_BUTT,Gdk::JOIN_MITER);
drawable->draw_lines(gc, Glib::ArrayHandle<Gdk::Point>(points));
}
// gc->set_function(Gdk::INVERT);
// gc->set_line_attributes(1,Gdk::LINE_SOLID,Gdk::CAP_BUTT,Gdk::JOIN_MITER);
// drawable->draw_lines(gc, Glib::ArrayHandle<Gdk::Point>(points));
- gc->set_rgb_fg_color(Gdk::Color("#000000"));
+ gc->set_rgb_fg_color(DUCK_COLOR_BEZIER_1);
gc->set_function(Gdk::COPY);
gc->set_line_attributes(1,Gdk::LINE_SOLID,Gdk::CAP_BUTT,Gdk::JOIN_MITER);
drawable->draw_lines(gc, Glib::ArrayHandle<Gdk::Point>(points));
- gc->set_rgb_fg_color(Gdk::Color("#afafaf"));
+ gc->set_rgb_fg_color(DUCK_COLOR_BEZIER_2);
gc->set_line_attributes(1,Gdk::LINE_ON_OFF_DASH,Gdk::CAP_BUTT,Gdk::JOIN_MITER);
drawable->draw_lines(gc, Glib::ArrayHandle<Gdk::Point>(points));
if(value_desc.is_valid() && value_desc.is_value_node() && get_work_area()->get_selected_value_node()==value_desc.get_value_node())
{
gc->set_function(Gdk::COPY);
- gc->set_rgb_fg_color(Gdk::Color("#FF0000"));
+ gc->set_rgb_fg_color(DUCK_COLOR_SELECTED);
//gc->set_line_attributes(1,Gdk::LINE_ON_OFF_DASH,Gdk::CAP_BUTT,Gdk::JOIN_MITER);
gc->set_line_attributes(2,Gdk::LINE_SOLID,Gdk::CAP_BUTT,Gdk::JOIN_MITER);
Point tl(min(point[0],boxpoint[0]),min(point[1],boxpoint[1]));
gc->set_function(Gdk::COPY);
- gc->set_rgb_fg_color(Gdk::Color("#FFFFFF"));
+ gc->set_rgb_fg_color(DUCK_COLOR_BOX_1);
gc->set_line_attributes(1,Gdk::LINE_SOLID,Gdk::CAP_BUTT,Gdk::JOIN_MITER);
drawable->draw_rectangle(gc,false,
round_to_int(tl[0]),
round_to_int(abs(boxpoint[1]-point[1]))
);
gc->set_function(Gdk::COPY);
- gc->set_rgb_fg_color(Gdk::Color("#000000"));
+ gc->set_rgb_fg_color(DUCK_COLOR_BOX_2);
gc->set_line_attributes(1,Gdk::LINE_ON_OFF_DASH,Gdk::CAP_BUTT,Gdk::JOIN_MITER);
drawable->draw_rectangle(gc,false,
round_to_int(tl[0]),
screen_duck.hover=hover;
if(!(*iter)->get_editable())
- screen_duck.color=(Gdk::Color("#cfcfcf"));
+ screen_duck.color=(DUCK_COLOR_NOT_EDITABLE);
else if((*iter)->get_tangent())
- screen_duck.color=((*iter)->get_scalar()<0?Gdk::Color("#ffff00"):Gdk::Color("#ff0000"));
+ screen_duck.color=((*iter)->get_scalar()<0 ? DUCK_COLOR_TANGENT_1 : DUCK_COLOR_TANGENT_2);
else if((*iter)->get_type()&Duck::TYPE_VERTEX)
- screen_duck.color=Gdk::Color("#ff7f00");
+ screen_duck.color=DUCK_COLOR_VERTEX;
else if((*iter)->get_type()&Duck::TYPE_RADIUS)
- screen_duck.color=Gdk::Color("#00ffff");
+ screen_duck.color=DUCK_COLOR_RADIUS;
else if((*iter)->get_type()&Duck::TYPE_WIDTH)
- screen_duck.color=Gdk::Color("#ff00ff");
+ screen_duck.color=DUCK_COLOR_WIDTH;
else if((*iter)->get_type()&Duck::TYPE_ANGLE)
- screen_duck.color=(Gdk::Color("#0000ff"));
+ screen_duck.color=(DUCK_COLOR_ANGLE);
else
- screen_duck.color=Gdk::Color("#00ff00");
+ screen_duck.color=DUCK_COLOR_OTHER;
screen_duck_list.push_front(screen_duck);
gc->set_function(Gdk::COPY);
gc->set_line_attributes(1,Gdk::LINE_SOLID,Gdk::CAP_BUTT,Gdk::JOIN_MITER);
- gc->set_rgb_fg_color(Gdk::Color("#000000"));
+ gc->set_rgb_fg_color(DUCK_COLOR_OUTLINE);
drawable->draw_arc(
gc,
true,
/* === M A C R O S ========================================================= */
+#define DUCK_COLOR_NOT_EDITABLE Gdk::Color("#cfcfcf")
+
+#define DUCK_COLOR_ANGLE Gdk::Color("#0000ff")
+#define DUCK_COLOR_RADIUS Gdk::Color("#00ffff")
+#define DUCK_COLOR_TANGENT_1 Gdk::Color("#ffff00")
+#define DUCK_COLOR_TANGENT_2 Gdk::Color("#ff0000")
+#define DUCK_COLOR_VERTEX Gdk::Color("#ff7f00")
+#define DUCK_COLOR_WIDTH Gdk::Color("#ff00ff")
+
+#define DUCK_COLOR_OTHER Gdk::Color("#00ff00")
+
+#define DUCK_COLOR_OUTLINE Gdk::Color("#000000") // the outline around each duck
+
+#define DUCK_COLOR_BEZIER_1 Gdk::Color("#000000") // the 2 colors used to draw bezier curves
+#define DUCK_COLOR_BEZIER_2 Gdk::Color("#afafaf")
+
+#define DUCK_COLOR_BOX_1 Gdk::Color("#ffffff") // the 2 colors used to draw boxes
+#define DUCK_COLOR_BOX_2 Gdk::Color("#000000")
+
+#define DUCK_COLOR_SELECTED Gdk::Color("#ff0000") // the color of the box drawn when a valuenode is selected
+
/* === T Y P E D E F S ===================================================== */
/* === C L A S S E S & S T R U C T S ======================================= */