Published
Edited
Jun 14, 2020
3 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
jabYellow = Jzazbz(srgb_to_xyz_abs(from_hex('#ffff00')))
Insert cell
//srgb_to_xyz_abs = (rgb) => srgb_to_xyz(rgb).map(X => X * display_white_luminance/100)
function xyz_abs_to_srgb (xyza) {
// not sure multiplying by 200 seems needed here
// dividing by 100 does not work, multiplying by 100 seems too little, 256 too much
return xyz_to_srgb(xyza).map(X => X * 200 )
}
Insert cell
{
const rgb = xyz_abs_to_srgb(Jzazbz_inverse(jabYellow))
const hex = d3.rgb(...rgb).hex()
return html`<input type=color value=${hex}>`
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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