🪄Util
Util
Kind: global class
.validateHex(hex) ⇒
boolean
.discordTime(time) ⇒
string
.formatTime(time) ⇒
string
.shorten(text, len) ⇒
string
.toAbbrev(num) ⇒
string
|string
.renderEmoji(ctx, msg, x, y) ⇒
Promise.<void>
.formatHex(hex, alt) ⇒
string
.invertColor(hex) ⇒
string
.getAcronym(name) ⇒
string
.getLines(params, text, ctx, maxWidth) ⇒
Array.<string>
new Util()
Canvacard Util
Util.validateHex(hex) ⇒ boolean
boolean
Validates hex
Kind: static method of Util
Param | Type | Description |
---|---|---|
hex |
| Hex code to validate |
Util.discordTime(time) ⇒ string
string
Converts regular timestamp to discord like time
Kind: static method of Util
Param | Type | Description |
---|---|---|
time |
| Timestamp to convert |
Util.formatTime(time) ⇒ string
string
Formats time
Kind: static method of Util
Param | Type | Description |
---|---|---|
time |
| Time to format |
Util.shorten(text, len) ⇒ string
string
Shorten text.
Kind: static method of Util
Param | Type | Description |
---|---|---|
text |
| Text to shorten |
len |
| Max Length |
Util.toAbbrev(num) ⇒ string
| string
string
| string
Converts numbers into units like 1K
, 1M
, 1B
etc.
Kind: static method of Util
Param | Type |
---|---|
num |
|
Util.renderEmoji(ctx, msg, x, y) ⇒ Promise.<void>
Promise.<void>
Renders text with emoji
Kind: static method of Util
Param | Type | Description |
---|---|---|
ctx |
| CanvasRenderingContext2D |
msg |
| Message |
x |
| X |
y |
| Y |
Util.formatHex(hex, alt) ⇒ string
string
Returns formatted hex code
Kind: static method of Util
Param | Type | Default | Description |
---|---|---|---|
hex |
| Hex code to format | |
alt |
|
| Alt color |
Util.invertColor(hex) ⇒ string
string
Inverts hex color
Kind: static method of Util
Param | Type | Description |
---|---|---|
hex |
| Hex color code to invert |
Util.getAcronym(name) ⇒ string
string
Returns acronym
Kind: static method of Util
Param | Type | Description |
---|---|---|
name |
| Name to parse acronym |
Util.getLines(params, text, ctx, maxWidth) ⇒ Array.<string>
Array.<string>
Returns array of lines
Kind: static method of Util
Param | Type | Description |
---|---|---|
params |
| Params |
text |
| Text |
ctx |
| CanvasRenderingContext2D |
maxWidth |
| Max width |
Last updated