Created
October 23, 2023 03:46
-
-
Save KeAWang/8f79634fd43150b62b99fc49f0b94627 to your computer and use it in GitHub Desktop.
Dexcom Clarity Color Palette
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| tir_palette = { | |
| "very_low": "#A61D2A", | |
| "low": "#EE1D23", | |
| "in_range": "#26B257", | |
| "high": "#FAAB1A", | |
| "very_high": "#F47D21" | |
| } | |
| def color_bg(bgs): | |
| bins = [0, 54, 70, 180, 250, 1000] | |
| bin_id = np.digitize(bgs, bins) - 1 | |
| colors = np.array(list(tir_palette.values()))[bin_id] | |
| return colors |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment