|
Last change
on this file since a762898 was e4c61dd, checked in by istevanoska <ilinastevanoska@…>, 6 months ago |
|
Prototype 1.1
|
-
Property mode
set to
100644
|
|
File size:
316 bytes
|
| Line | |
|---|
| 1 | import {rgb} from "d3-color";
|
|---|
| 2 |
|
|---|
| 3 | var c = rgb(),
|
|---|
| 4 | pi_1_3 = Math.PI / 3,
|
|---|
| 5 | pi_2_3 = Math.PI * 2 / 3;
|
|---|
| 6 |
|
|---|
| 7 | export default function(t) {
|
|---|
| 8 | var x;
|
|---|
| 9 | t = (0.5 - t) * Math.PI;
|
|---|
| 10 | c.r = 255 * (x = Math.sin(t)) * x;
|
|---|
| 11 | c.g = 255 * (x = Math.sin(t + pi_1_3)) * x;
|
|---|
| 12 | c.b = 255 * (x = Math.sin(t + pi_2_3)) * x;
|
|---|
| 13 | return c + "";
|
|---|
| 14 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.