Skip to content

Commit

Permalink
+ rgba => hash
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudcome committed Apr 27, 2018
1 parent 7d4b39b commit 8fd26f9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/sources/rgba.js
Expand Up @@ -54,7 +54,7 @@ function toHex(rgba) {
];

if (rgba.a < 1) {
hexList.push(round(rgba.a));
hexList.push(toString16(round(rgba.a * 255)));
}

return '#' + hexList.join('');
Expand Down
10 changes: 5 additions & 5 deletions test/sources/test.rgba.js
Expand Up @@ -45,11 +45,11 @@ describe('rgba', function () {
a: 1
})).toEqual('#01167b');
expect(rgba.toHex({
r: 90,
g: 12,
b: 311,
a: 0.6
})).toEqual('#5a0c1371');
r: 1,
g: 3,
b: 5,
a: 0.7
})).toEqual('#010305b3');
});

it('.toHsl', function () {
Expand Down

0 comments on commit 8fd26f9

Please sign in to comment.