[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Standardize format of `in_color` (issue 329140043 by address@hidden)
From: |
beauleetienne0 |
Subject: |
Standardize format of `in_color` (issue 329140043 by address@hidden) |
Date: |
Sat, 09 Sep 2017 10:25:00 -0700 |
Reviewers: ,
Message:
This is a minor nitpick, just making the format of color commands more
consistent. Found it while trying to fix 3778, but fixing it is a big
challenge I don't think I'm capable of, sadly.
Description:
Standardize format of `in_color`
The skyline line-pair (as used in `-ddebug-skylines`) used a 0-255 range
for color selection, while other uses use a 0-1 range.
The use of the 0-255 range makes weird output, such as "25500.0000%".
Please review this at https://codereview.appspot.com/329140043/
Affected files (+6, -6 lines):
M lily/axis-group-interface.cc
M lily/separation-item.cc
M lily/system.cc
Index: lily/axis-group-interface.cc
diff --git a/lily/axis-group-interface.cc b/lily/axis-group-interface.cc
index
ac6f85feb8e25bb810875d47567708194d762cd3..a854927e233e53054b34b2c280bc3b313f4bc217
100644
--- a/lily/axis-group-interface.cc
+++ b/lily/axis-group-interface.cc
@@ -988,9 +988,9 @@ Axis_group_interface::print (SCM smob)
if (Skyline_pair *s = unsmob<Skyline_pair> (me->get_property
("vertical-skylines")))
{
ret.add_stencil (Lookup::points_to_line_stencil (0.1,
(*s)[UP].to_points (X_AXIS))
- .in_color (255, 0, 255));
+ .in_color (1, 0, 1));
ret.add_stencil (Lookup::points_to_line_stencil (0.1,
(*s)[DOWN].to_points (X_AXIS))
- .in_color (0, 255, 255));
+ .in_color (0, 1, 1));
}
return ret.smobbed_copy ();
}
Index: lily/separation-item.cc
diff --git a/lily/separation-item.cc b/lily/separation-item.cc
index
e29b8a912960454e099e1a89a5b367369c751c4d..93eb91626005f22b3c3eb51af72e5ed029715642
100644
--- a/lily/separation-item.cc
+++ b/lily/separation-item.cc
@@ -205,8 +205,8 @@ Separation_item::print (SCM smob)
Stencil ret;
if (Skyline_pair *s = unsmob<Skyline_pair> (me->get_property
("horizontal-skylines")))
{
- ret.add_stencil (Lookup::points_to_line_stencil (0.1,
(*s)[LEFT].to_points (Y_AXIS)).in_color (255, 255, 0));
- ret.add_stencil (Lookup::points_to_line_stencil (0.1,
(*s)[RIGHT].to_points (Y_AXIS)).in_color (0, 255, 255));
+ ret.add_stencil (Lookup::points_to_line_stencil (0.1,
(*s)[LEFT].to_points (Y_AXIS)).in_color (1, 1, 0));
+ ret.add_stencil (Lookup::points_to_line_stencil (0.1,
(*s)[RIGHT].to_points (Y_AXIS)).in_color (0, 1, 1));
}
return ret.smobbed_copy ();
}
Index: lily/system.cc
diff --git a/lily/system.cc b/lily/system.cc
index
0551b85cbccda5286e770fdc238722edda48aec7..586db6801a23f644c935cfc907746b0979394d8e
100644
--- a/lily/system.cc
+++ b/lily/system.cc
@@ -625,8 +625,8 @@ System::get_paper_system ()
= Lookup::points_to_line_stencil (0.1,
(*skylines)[UP].to_points (X_AXIS));
Stencil down
= Lookup::points_to_line_stencil (0.1,
(*skylines)[DOWN].to_points (X_AXIS));
- sys_stencil.add_stencil (up.in_color (255, 0, 0));
- sys_stencil.add_stencil (down.in_color (0, 255, 0));
+ sys_stencil.add_stencil (up.in_color (1, 0, 0));
+ sys_stencil.add_stencil (down.in_color (0, 1, 0));
}
}
- Standardize format of `in_color` (issue 329140043 by address@hidden),
beauleetienne0 <=