[pitivi] common: add an covertion function from hex to rgb color
- From: Thibault Saunier <tsaunier src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] common: add an covertion function from hex to rgb color
- Date: Sat, 13 Aug 2011 13:26:55 +0000 (UTC)
commit 8f5189e6059450b81c847bb92f70ac1d96b5d261
Author: Lubosz Sarnecki <lubosz gmail com>
Date: Fri Aug 12 23:29:22 2011 +0200
common: add an covertion function from hex to rgb color
pitivi/ui/common.py | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/pitivi/ui/common.py b/pitivi/ui/common.py
index 0f8a49c..fa0fce3 100644
--- a/pitivi/ui/common.py
+++ b/pitivi/ui/common.py
@@ -189,22 +189,19 @@ audio_rates = model((str, int), (
(_("%d KHz") % 22, 22050),
(_("%.1f KHz") % 44.1, 44100),
(_("%d KHz") % 48, 48000),
- (_("%d KHz") % 96, 96000)
-))
+ (_("%d KHz") % 96, 96000)))
audio_depths = model((str, int), (
(_("%d bit") % 8, 8),
(_("%d bit") % 16, 16),
(_("%d bit") % 24, 24),
- (_("%d bit") % 32, 32)
-))
+ (_("%d bit") % 32, 32)))
audio_channels = model((str, int), (
(_("6 Channels (5.1)"), 6),
(_("4 Channels (4.0)"), 4),
(_("Stereo"), 2),
- (_("Mono"), 1)
-))
+ (_("Mono"), 1)))
def set_combo_value(combo, value, default_index=-1):
@@ -219,3 +216,7 @@ def set_combo_value(combo, value, default_index=-1):
def get_combo_value(combo):
active = combo.get_active()
return combo.props.model[active][1]
+
+
+def hex_to_rgb(value):
+ return tuple(float(int(value[i:i + 2], 16)) / 255.0 for i in range(0, 6, 2))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]