0.1.0-alpha.1 • Published 4 years ago

halfeind-utils v0.1.0-alpha.1

Weekly downloads
22
License
-
Repository
-
Last release
4 years ago

halfeind-utils NPM JavaScript Style Guide

Install

npm install --save halfeind-utils
yarn add halfeind-utils

Usage

import { randomHexColor } from 'halfeind-utils';
 
const App = () => (
  <>
    <div style={{width:'100%',height:'100%',backgroundColor:randomHexColor()}}></div>
  </>
);

Featured functions

Color

randomHexColor()

Creates a random hexadecimal color.
contrastColor(color)

Generates a contrast color based on the a given color.
hsvToRgb(h, s, v)

Converts HSV-color to rgb.
hsvToHsl(h, s, v)

Converts HSV-color to HSL.
rgbToHsv(r, g, b)

Converts rgb-color to HSV.
hexToRgb(hex)

Converts hex-color to rgb.
rgbToHex(r, g, b)

Converts rgb-color to hex.
hslToRgb(h, s, l)

Converts HSL-color to rgb.

String

acronym(string)

Generates the acronym based on the given string.
isEmpty(string)

Returns true or false, depending if the given string is an empty string or undefined.
RandomString(length)

Returns a random string with the amount of characters based on the given length.

Date

getCurrentYear()

Returns the current year.
getCurrentMonth()

Returns the current month.
getCurrentDay()

Returns the current day.
getMonthName(monthNumber)

Returns month info based on the given monthNumber.
getDayByDayNumber(dayNumber)

Returns day info based on the given dayNumber.
getDayByDate(month, dayOfMonth, year)

Returns day info based on the given month, dayOfMonth and year.
daysInMonth(monthNumber, year)

Returns the amount of days based on the given month and year.
daysInCurrentMonth()

Returns the amount of days in current month.

License

MIT © halfeind

0.2.2-alpha.0

4 years ago

0.2.1-alpha.0

4 years ago

0.2.1-alpha.1

4 years ago

0.2.0-alpha.0

4 years ago

0.1.1-alpha.0

4 years ago

0.1.0-alpha.1

4 years ago

0.1.0-alpha.0

4 years ago

0.0.7-alpha.0

4 years ago

0.0.6-alpha.0

4 years ago

0.0.5-alpha.0

4 years ago

0.0.4-alpha.0

4 years ago

0.0.3-alpha.1

4 years ago

0.0.3-alpha.0

4 years ago

0.0.2-alpha.0

4 years ago

0.0.2-alpha.1

4 years ago

0.0.1-alpha.0

4 years ago

0.0.1-alpha

4 years ago

0.0.14

4 years ago

0.0.13

4 years ago

0.0.12

4 years ago

0.0.11

4 years ago

0.0.10

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.1

4 years ago