From c35bc016fae91edae3b9abb1e6d0fac171e6d582 Mon Sep 17 00:00:00 2001 From: Lokesh Dhakar Date: Sun, 4 Aug 2019 10:00:34 -0700 Subject: [PATCH] docs: Add syntax highlighting --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index fbc5ee5..fb4317b 100644 --- a/README.md +++ b/README.md @@ -10,17 +10,17 @@ A script for grabbing the color palette from an image. Works in browser and in N ### Install and import _Important: The name of the package is `colorthief`, not `color-thief`._ -``` +```console npm i --save colorthief ``` -``` +```js const ColorThief = require('colorthief'); ``` ### Get colors Both `getColor` and `getPalette` return a `Promise` when used in Node. -``` +```js const img = resolve(process.cwd(), 'rainbow.png'); ColorThief.getColor(img) @@ -38,13 +38,13 @@ ColorThief.getPalette(img, 5) ### Install _Important: The name of the package is `colorthief`, not `color-thief`._ -``` +```console npm i --save colorthief ``` ### Import and use as a global variable -``` +```html ``` _app.js_ -``` +```js import ColorThief from './node_modules/colorthief/dist/color-thief.mjs' const colorThief = new ColorThief();