Published
Edited
Jun 29, 2022
3 stars
Insert cell
Insert cell
Color = import("https://colorjs.io/dist/color.js?1").then((d) => d.default)
Insert cell
viewof a = show(new Color("slategray"))
Insert cell
viewof b = show(new Color("hwb", [60, 30, 40], 0.5))
Insert cell
// the super-vivid P3 colors work only on Safari for now
show(new Color({ space: "p3", coords: [0, 1, 0], alpha: 0.9 }))
Insert cell
Insert cell
show = (color) =>
htl.html`<div style=${{
background: color,
color: color.lch.l > 60 ? "black" : "white"
}}>${color}`
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