Skip to content

Commit

Permalink
refactor(color): simplify int24Css()
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Jan 29, 2021
1 parent d5d605e commit ebe3948
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/color/src/int/int-css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,5 @@ export const int32Css = (src: number | IDeref<number>) => {
: `#${U24(src & 0xffffff)}`;
};

export const int24Css = (src: number | IDeref<number>) => {
src = typeof src === "number" ? src : src.deref();
return int32Css(src | 0xff000000);
};
export const int24Css = (src: number | IDeref<number>) =>
`#${U24((typeof src === "number" ? src : src.deref()) & 0xffffff)}`;

0 comments on commit ebe3948

Please sign in to comment.