Skip to content

Instantly share code, notes, and snippets.

@KeAWang
Created October 23, 2023 03:46
Show Gist options
  • Select an option

  • Save KeAWang/8f79634fd43150b62b99fc49f0b94627 to your computer and use it in GitHub Desktop.

Select an option

Save KeAWang/8f79634fd43150b62b99fc49f0b94627 to your computer and use it in GitHub Desktop.
Dexcom Clarity Color Palette
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