File size: 468 Bytes
bc20498
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

/* IMPORT */

import _ from '~/utils';
import ChannelsReusable from '~/channels/reusable';
import Color from '~/color';

/* MAIN */

const hsla = ( h: number, s: number, l: number, a: number = 1 ): string => {

  const channels = ChannelsReusable.set ({
    h: _.channel.clamp.h ( h ),
    s: _.channel.clamp.s ( s ),
    l: _.channel.clamp.l ( l ),
    a: _.channel.clamp.a ( a )
  });

  return Color.stringify ( channels );

};

/* EXPORT */

export default hsla;