summaryrefslogtreecommitdiffstats
path: root/src/sp-guide.cpp
diff options
context:
space:
mode:
authorFelipe Corr??a da Silva Sanches <juca@members.fsf.org>2011-06-18 08:51:28 +0000
committerFelipe C. da S. Sanches <juca@members.fsf.org>2011-06-18 08:51:28 +0000
commit637e36780dacfed78c322064e322f247bd764fd1 (patch)
tree66c8f43162231ba5e5ddf3b12ded0b0b320f4f70 /src/sp-guide.cpp
parentcmake: correct syntax error. (diff)
downloadinkscape-637e36780dacfed78c322064e322f247bd764fd1.tar.gz
inkscape-637e36780dacfed78c322064e322f247bd764fd1.zip
user interface for selecting colors of guidelines
(bzr r10315)
Diffstat (limited to 'src/sp-guide.cpp')
-rw-r--r--src/sp-guide.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/sp-guide.cpp b/src/sp-guide.cpp
index 584a6a366..19b64eb1a 100644
--- a/src/sp-guide.cpp
+++ b/src/sp-guide.cpp
@@ -412,6 +412,23 @@ void sp_guide_set_normal(SPGuide &guide, Geom::Point const normal_to_line, bool
*/
}
+void sp_guide_set_color(SPGuide &guide, const unsigned char r, const unsigned char g, const unsigned char b, bool const commit)
+{
+ g_assert(SP_IS_GUIDE(&guide));
+ guide.color = (r << 24) | (g << 16) | (b << 8) | 0x7f;
+
+ if (guide.views){
+ sp_guideline_set_color(SP_GUIDELINE(guide.views->data), guide.color);
+ }
+
+ if (commit){
+ std::ostringstream os;
+ os << "rgb(" << r << "," << g << "," << b << ")";
+ //XML Tree being used directly while it shouldn't be
+ guide.getRepr()->setAttribute("inkscape:color", os.str().c_str());
+ }
+}
+
void sp_guide_set_label(SPGuide &guide, const char* label, bool const commit)
{
g_assert(SP_IS_GUIDE(&guide));