[baobab/color-unify: 3/5] Get the base color in a separate function
- From: Stefano Facchini <sfacchini src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [baobab/color-unify: 3/5] Get the base color in a separate function
- Date: Sun, 28 Jun 2020 10:58:50 +0000 (UTC)
commit 73a8d859d6470eb8ec85fca115859e6784d714a6
Author: Stefano Facchini <stefano facchini gmail com>
Date: Tue Jun 16 14:44:40 2020 +0200
Get the base color in a separate function
src/baobab-chart.vala | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/baobab-chart.vala b/src/baobab-chart.vala
index 3b8b2c2..66c3344 100644
--- a/src/baobab-chart.vala
+++ b/src/baobab-chart.vala
@@ -430,10 +430,9 @@ namespace Baobab {
return color;
}
- protected Gdk.RGBA get_item_color (ChartItem item, double rel_position, bool highlighted) {
- var context = get_style_context ();
-
+ Gdk.RGBA get_base_color (ChartItem item, double rel_position) {
var color = Gdk.RGBA ();
+ var context = get_style_context ();
double intensity = 1 - (((item.depth - 1) * 0.3) / MAX_DEPTH);
@@ -455,6 +454,13 @@ namespace Baobab {
color.blue *= intensity;
}
+ return color;
+ }
+
+ protected Gdk.RGBA get_item_color (ChartItem item, double rel_position, bool highlighted) {
+ var color = get_base_color (item, rel_position);
+ var context = get_style_context ();
+
if (highlighted) {
if (item.depth == 0) {
context.lookup_color ("level_color_hi", out color);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]