Platform
Resources
Pricing
Sign in
Get started
Eric Portis
Web Platform Advocate at @CloudinaryLtd
Workspace
Fork
Published
By
Eric Portis
Edited
May 1, 2020
Insert cell
md
`# Lab interpolation`
Insert cell
blue
=
d3
.
lab
(
'blue'
)
Insert cell
white
=
d3
.
lab
(
'white'
)
Insert cell
f
=
d3
.
interpolate
(
blue
,
white
)
Insert cell
lightblue
=
f
(
0.5
)
Insert cell
blue
.
formatRgb
(
)
Insert cell
white
.
formatRgb
(
)
Insert cell
lightbluestring
=
d3
.
lab
(
lightblue
.
l
,
lightblue
.
a
,
lightblue
.
b
)
.
formatRgb
(
)
Insert cell
html
`<div style="width: 100px; height: 100px; background-color: ${
lightbluestring
}" />`
Insert cell
d3
=
require
(
'd3'
,
'd3-color'
,
'd3-cam02'
)
;
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.
Try it for free
Learn more
Fork
View
Export
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
blue
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
white
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
f
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
lightblue
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
lightbluestring
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
d3
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML