Changeset 1943949
- Timestamp:
- 09/19/2018 09:27:22 PM (8 years ago)
- Location:
- amilia-store/trunk
- Files:
-
- 2 edited
-
amilia-store-calendar.php (modified) (2 diffs)
-
amilia-store.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
amilia-store/trunk/amilia-store-calendar.php
r1943878 r1943949 137 137 return removeColorFromActivityName(event.ExtraInformation) || event.ActivityName; 138 138 } 139 function invertColor(hex) { 140 if (hex.indexOf('#') === 0) hex = hex.slice(1); 141 if (hex.length === 3) hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2]; 142 if (hex.length !== 6) return '#FFFFFF'; 143 var r = parseInt(hex.slice(0, 2), 16), 144 g = parseInt(hex.slice(2, 4), 16), 145 b = parseInt(hex.slice(4, 6), 16); 146 return (r * 0.299 + g * 0.587 + b * 0.114) > 186 ? '#000000' : '#FFFFFF'; 147 } 139 148 140 149 function render() { … … 192 201 var event = data[i]; 193 202 event.color = getColorFromActivityName(event.ExtraInformation) || '#46aaf8'; 203 event.textColor = invertColor(event.color); 194 204 event.title = getDisplayNameFromEvent(event); 195 205 } -
amilia-store/trunk/amilia-store.php
r1943878 r1943949 6 6 Author: Martin Drapeau <martin.drapeau@amilia.com> 7 7 Copyright: 2014-2018 Amilia 8 Version: 2.6. 48 Version: 2.6.5 9 9 Author URI: http://www.amilia.com/ 10 10 License: Apache License 2.0
Note: See TracChangeset
for help on using the changeset viewer.