Public
Edited
Nov 27, 2023
Insert cell
Insert cell
EA_COLORES_MAP
Insert cell
htl.html`
<div style="width: 20px; height: 1em; background-color: #3498db; display: inline-block; margin-right: 0px;"></div>
<span style="vertical-align: middle;">Blue</span>
`
Insert cell
chroma.contrast('red', 'white')
Insert cell
Insert cell
Insert cell
Insert cell
colores_info = {
let data = []
EA_COLORES_NOMBRES.forEach(d => {
let info = {}
info['name'] = d
info['hex'] = EA_COLORES_MAP[d]
info['contrast_white'] = chroma.contrast(info['hex'], 'white')

data.push(info)
})
return data
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
get_colorhtml('blue', 'blue')
Insert cell
function get_colorhtml(color_name, color_css) {
return htl.html`
<div style="width: 20px; height: 1em; background-color: ${color_css}; display: inline-block; margin-right: 0px;"></div>
<span style="vertical-align: middle;">${color_name}</span>
`
}
Insert cell
chroma('#A1F880').darken().hex(); // #6EC551
Insert cell
EA_COLORES_NOMBRES
Insert cell
Insert cell
chroma = require("chroma-js")
Insert cell
import {EA_COLORES_NOMBRES, EA_COLORES_MAP} from "22dc6182207c44c8"
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more