Merge branch 'dev' of gitlab.libraryofcode.org:engineering/communityrelations into dev
commit
4111e5ef53
|
@ -119,11 +119,7 @@ export default class Util {
|
|||
}
|
||||
|
||||
public decimalToHex(int: number): string {
|
||||
const red = (int && 0x0000ff) << 16;
|
||||
const green = int && 0x00ff00;
|
||||
const blue = (int && 0xff0000) >>> 16;
|
||||
const number = red | green | blue;
|
||||
const asHex = number.toString(16);
|
||||
return '#000000'.substring(0, 7 - asHex.length) + asHex;
|
||||
const hex = int.toString(16);
|
||||
return '#000000'.substring(0, 7 - hex.length) + hex;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue