From d0ae68f0bf5d33e7f97c3944b7ec6f5e87680e74 Mon Sep 17 00:00:00 2001 From: "Eduardo M. Santos" <160991364+supitsdu@users.noreply.github.com> Date: Mon, 10 Jun 2024 13:00:38 -0300 Subject: [PATCH] docs: Update README.md API Reference (#12) - Fix toRgb(), toHsl(), toHsv(), and toCmyk() methods description - Add toNamed() method description --- README.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 6c15392..0067c44 100644 --- a/README.md +++ b/README.md @@ -22,13 +22,13 @@ npm i colorus-js ## Usage ```js -const { Colorus } = require('colorus-js'); +const { Colorus } = require('colorus-js') // Create a new Colorus instance -const color = new Colorus('rgb(255 0 0)'); +const color = new Colorus('rgb(255 0 0)') -console.log(color.colorType); // Returns: 'rgb' -console.log(color.lighten(0.2).toHex({ minify: true })); // Returns: '#F33' +console.log(color.colorType) // Returns: 'rgb' +console.log(color.lighten(0.2).toHex({ minify: true })) // Returns: '#F33' ``` ## API Reference @@ -59,10 +59,11 @@ constructor(input?: AnyColor) #### Methods - `toHex(options): string`: Convert the current color to hexadecimal format. -- `toRgb(options): string`: Convert the current color to RgbObject format. -- `toHsl(options): string`: Convert the current color to HslObject format. -- `toHsv(options): string`: Convert the current color to HsvObject format. -- `toCmyk(options): string`: Convert the current color to CmykObject format. +- `toRgb(options): string`: Convert the current color to `RGB` string format. +- `toHsl(options): string`: Convert the current color to `HSL` string format. +- `toHsv(options): string`: Convert the current color to `HSV` string format. +- `toCmyk(options): string`: Convert the current color to `CMYK` string format. +- `toNamed(): string`: Convert the current color to its nearest [CSS named color](https://www.w3.org/TR/css-color-4/#named-colors) representation. - `mix(input, amount): Colorus`: Mixes the current color with another color. - `lighten(amount): Colorus`: Lightens the current color. - `darken(amount): Colorus`: Darkens the current color.