From b4a0ab8cf069ec1e50131aedb2649c928ff96771 Mon Sep 17 00:00:00 2001 From: hjank <jank@uni-potsdam.de> Date: Tue, 8 Dec 2015 11:01:36 +0100 Subject: [PATCH] # moved color retrieval functions into formatSelection --- js/authoring/formatSelections.js | 41 ++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/js/authoring/formatSelections.js b/js/authoring/formatSelections.js index 5a007bf..67c52f0 100644 --- a/js/authoring/formatSelections.js +++ b/js/authoring/formatSelections.js @@ -148,4 +148,45 @@ function chooseMetaIcon(metaDataName) { case "3D Umgebung": return "fui-windows"; } +} + + + +// get the specific color for each context class +/** + * Function finds specific color of a context class. + * @param {String} cc Contains a context class. + * @return {String} Returns the specific color. + * */ +function getColor(cc) { + switch (cc) { + case "Lernszenario": + return "#3287C8"; + case "Persönlich": + return "#AF46C8"; + case "Situationsbezogen": + return "#91F52D"; + case "Infrastruktur": + return "#969696"; + case "Umwelt": + return "#FADC3C"; + case "Ortung": + return "#F03C32"; + } +} + + +// get the color of each context class' label (depending on background color) +function getClassNameColor(classText) { + // a little bit cumbersome but slightly easier to maintain + switch (classText) { + case "Lernszenario": + case "Persönlich": + case "Infrastruktur": + case "Ortung": + return "white"; + case "Situationsbezogen": + case "Umwelt": + return "#555555"; + } } \ No newline at end of file -- GitLab