color

Functions group for work with colors.

hex-to-hsl

Converts HEX color value to HSL.

Arguments:

NameTypeDefaultDescription
$hex *colorColor HEX value.
$separatorstringcommaThe output list separator.
space | comma | slash | auto

Returns:

list - The list of HSL values structured of (hue, saturation, lightness).

Example:

@use 'more-sass' as more;
@debug more.hex-to-hsl(#ff0000); // list: 0deg, 100%, 50%

hex-to-rgb

Converts HEX color value to RGB.

Arguments:

NameTypeDefaultDescription
$hex *colorColor HEX value.
$separatorstringcommaThe output list separator.
space | comma | slash | auto

Returns:

list - The list of RGB values structured of (red, green, blue).

Example:

@use 'more-sass' as more;
@debug more.hex-to-rgb(#ff0000); // list: 255, 0, 0

shade

Mixes a given color with black.

Arguments:

NameTypeDefaultDescription
$color *colorThe original color.
$amountnumber10Amount of the black color in the result color (%).

Returns:

color - The result color of mixing the original color with black.

Example:

@use 'more-sass' as more;
@debug more.shade(#808080, 45); // color: #464646

social-color

Retrieves a given social media brand color.

Arguments:

NameTypeDefaultDescription
$social *stringSocial media code ('vk', 'fb', 'tw', etc.).

Returns:

?color - Social media brand color.

Example:

@use 'more-sass' as more;
@debug more.social-color('fb'); // color: #4267b2

List of available codes:

  • vk - VKontakte
  • fb - Facebook
  • ok - Odnoklassniki
  • yt - YouTube
  • tw - Twitter
  • ig - Instagram (purple)
  • ig-gradient - Instagram (gradient)
  • tg - Telegram
  • dr - Dribble
  • be - Behance
  • li - Linked In
  • wa - WhatsApp
  • vb - Viber

tint

Mixes a given color with white.

Arguments:

NameTypeDefaultDescription
$color *colorThe original color.
$amountnumber10Amount of the white color in the result color (%).

Returns:

color - The result color of mixing the original color with white.

Example:

@use 'more-sass' as more;
@debug more.tint(#808080, 45); // color: #b9b9b9
Edit this page on GitHub Updated at Mon, Jan 30, 2023