Skip to content
CHE5YA edited this page Jan 25, 2024 · 3 revisions

ConvertDecimalToHex

Converts a decimal number to its hexadecimal representation.

Since

1.0.0

Arguments

  • number: The decimal number to convert.

Returns

  • (string): Returns the hexdecimal representation of the decimal number.

Example

import { ConvertDecimalToHex } from 'makeasy';

ConvertDecimalToHex(10);
// => 0a

ConvertDecimalToHex(255);
// => ff

ConvertHSLToHex

Converts an HSL (Hue, Saturation, Lightness) color value to its corresponding Hexadecimal representation.

Since

1.0.0

Arguments

  • hue (number): The hue value (0-360).
  • saturation (number): The saturation value (0-100).
  • lightness (number): The lightness value (0-100).

Returns

(string): Returns the Hexadecimal representation of the HSL color.

Example

import ConvertHSLToHex from 'makeasy';

console.log(ConvertHSLToHex(120, 100, 50));
// => "#00ff00"

console.log(ConvertHSLToHex(0, 0, 0));
// => "#000000"

console.log(ConvertHSLToHex(0, 100, 100));
// => "#ffffff"

Clone this wiki locally