Skip to content

Commit

Permalink
Added practical examples
Browse files Browse the repository at this point in the history
  • Loading branch information
jer-echo committed Jun 23, 2022
1 parent 996e613 commit ac1dc86
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,29 @@ import numesis module on your project directly
```js
import Numesis from 'https://deno.land/x/numesis/mod.ts'
```
## Example
```js
const hex = new Numesis("0123456789ABCDEF");
const dec = new Numesis("0123456789");
const bin = new Numesis("01");
const oct = new Numesis("01234567");

console.log(`Hex value of 255 is ${hex.e(255)}`);
// Output: Hex value of 255 is FF

console.log(`Oct value of 255 is ${oct.e(255)}`);
// Output: Oct value of 255 is 377

console.log(`Dec value of 255 is ${dec.e(255)}`);
// Output: Dec value of 255 is 255

console.log(`Bin value of 255 is ${bin.e(255)}`);
// Output: Bin value of 255 is 11111111

// Convert RGB Color
console.log(`Convert RGB(255,255,255) to HEX is ${hex.e(255,255,255)}`);
// Output: Covert RGB(255,255,255) to HEX is FFFFFFFF
```
## Usage
### With deno
```js
Expand Down

0 comments on commit ac1dc86

Please sign in to comment.