diff --git a/.markdownlint.json b/.markdownlint.json new file mode 100644 index 00000000..d75f2de5 --- /dev/null +++ b/.markdownlint.json @@ -0,0 +1,4 @@ +{ + "MD013": false, + "MD001":false +} \ No newline at end of file diff --git a/data/blog/achromatic.md b/data/blog/achromatic.md index 165eea16..bbe7d2bc 100644 --- a/data/blog/achromatic.md +++ b/data/blog/achromatic.md @@ -12,7 +12,7 @@ These are a subtype of colors that have no _hue_. Also known as grays, these col We can use the _isAchromatic_ utility to check if a color is achromatic or not. **Parameters:** -(color:Color):boolean +`(color:Color):boolean` color The color to test if it is achromatic or not. **Returns:** diff --git a/data/blog/array-methods.md b/data/blog/array-methods.md index d4a90e56..5a59b246 100644 --- a/data/blog/array-methods.md +++ b/data/blog/array-methods.md @@ -21,8 +21,8 @@ All the filtering functions: #### filterByDistance **Parameters:** -(colors: Color[],against: Color,startDistance = 0.05,endDistance?: number, -mode?: ColorSpaces, weights?: [number, number, number, number]) +`(colors: Color[],against: Color,startDistance = 0.05,endDistance?: number, +mode?: ColorSpaces, weights?: [number, number, number, number])` _startDistance_ **The minimum end of the distance range.** _endDistance_ **The maximum end of the distance range.** _weights_ **The weighting values to pass to the Euclidean function. Default is [1,1,1,0].** @@ -43,7 +43,7 @@ Returns an array of colors with the specified distance range. The distance is te #### filterByContrast **Parameters:** -(colors: Color[], against: Color, startContrast = 0.05, endContrast?: number): Color[] +`(colors: Color[], against: Color, startContrast = 0.05, endContrast?: number): Color[]` _colors_ **The array of colors to filter.** _startContrast_ **The minimum end of the contrast range.** _endContrast_ **The maximum end of the contrast range.** @@ -80,7 +80,7 @@ console.log(filterByContrast(sample, 'green', '>=3')) #### filterByHue **Parameters:** -(colors: Color[], startHue = 0, endHue = 360):Colors[] +`(colors: Color[], startHue = 0, endHue = 360):Colors[]` _colors_ **The array of colors to filter.** _startHue_ **The minimum end of the hue range.** _endHue_ **The maximum end of the hue range.** @@ -117,7 +117,7 @@ filterByHue(sample, 20, 80) #### filterByLuminance **Parameters:** -(colors: Color[], startLuminance = 0.05, endLuminance = 1):Colors[] +`(colors: Color[], startLuminance = 0.05, endLuminance = 1):Colors[]` _colors_ The array of colors to filter. _startLuminance_ **The minimum end of the luminance range.** _endLuminance_ **The maximum end of the luminance range.** @@ -154,7 +154,7 @@ filterByLuminance(sample, 0.4, 0.9) #### filterBySaturation **Parameters:** -(colors, startSaturation = 0.05, endSaturation = 1):Color[] +`(colors, startSaturation = 0.05, endSaturation = 1):Color[]` _colors_ The array of colors to filter. _startSaturation_ **The minimum end of the saturation range.** _endSaturation_ **The maximum end of the saturation range.** @@ -199,7 +199,7 @@ filterBySaturation(sample, 0.1, 0.8); #### filterByTemp **Parameters:** -(colors, startTemp = 1000, endTemp = 6000):Color[] +`(colors, startTemp = 1000, endTemp = 6000):Color[]` _colors_ **The array of colors to filter.** _startTemp_ **The minimum end of the temperature range.** _endTemp_ **The maximum end of the temperature range.** @@ -241,7 +241,7 @@ filterByTemp(sample, 1000, 20000); #### filterByLightness **Parameters:** -(colors,startLightness = 5,endLightness = 100): Color[] +`(colors,startLightness = 5,endLightness = 100): Color[]` _colors_ **The array of colors to filter.** _startLightness_ **The minimum end of the lightness range.** _endLightness_ **The maximum end of the lightness range.** @@ -286,7 +286,7 @@ All the sorting functions: #### sortByLuminance **Parameters:** -(colors:Color[], order:'asc' | 'desc'):Color[] +`(colors:Color[], order:'asc' | 'desc'):Color[]` _colors_ **The array of colors to sort** _order_ **The expected order of arrangement. Either 'asc' or 'desc'. Default is ascending ('asc')** @@ -343,7 +343,7 @@ console.log(sortedDescending) #### sortBySaturation **Parameters:** -(colors:Color[], order:'asc' | 'desc'):Color[] +`(colors:Color[], order:'asc' | 'desc'):Color[]` colors The array of colors to sort order The expected order of arrangement. Either 'asc' or 'desc'. Default is ascending ('asc') @@ -399,7 +399,7 @@ console.log(sortedDescending) #### sortByHue **Parameters:** -(colors:Color[], order:'asc' | 'desc'):Color[] +`(colors:Color[], order:'asc' | 'desc'):Color[]` _colors_ **The array of colors to sort** _order_ **The expected order of arrangement. Either 'asc' or 'desc'. Default is ascending ('asc')** _mode_ **The color space to compute the color distances in. All colors within the collection will be converted to mode. Also note that because differences in hue mapping certain color spaces such as HSL and LCH hue values do not align. Keep such quirks in mind to avoid weird results.** @@ -457,7 +457,7 @@ console.log(sortedDescending) #### sortByTemp **Parameters:** -(colors:Color[], order:'asc' | 'desc'):Color[] +`(colors:Color[], order:'asc' | 'desc'):Color[]` _colors_ **The array of colors to sort** _order_ **The expected order of arrangement. Either 'asc' or 'desc'. Default is ascending ('asc')** @@ -495,7 +495,7 @@ console.log(sortedDescending) #### sortByLightness **Parameters:** -(colors:Color[], order:'asc' | 'desc'):Color[] +`(colors:Color[], order:'asc' | 'desc'):Color[]` _colors_ **The array of colors to sort** _order_ **The expected order of arrangement. Either 'asc' or 'desc'. Default is ascending ('asc')** @@ -554,7 +554,7 @@ sortByLightness(sample,'desc') #### sortByDistance **Parameters:** -(colors: Color[],against: Color,order?: "asc" | "desc", mode?: ColorSpaces, weights?: [number, number, number, number]): Color[] +`(colors: Color[],against: Color,order?: "asc" | "desc", mode?: ColorSpaces, weights?: [number, number, number, number]): Color[]` _colors_ **The array of colors to sort.** _against_ **The color to compare the distance with. All the distances are calculated between this color and the ones in the colors array.** _order_ **The expected order of arrangement. Either 'asc' or 'desc'. Default is ascending ('asc')** @@ -593,7 +593,7 @@ console.log( #### sortByContrast **Parameters:** -(colors: Color[],against: Color,order: "asc" | "desc"): Color[] +`(colors: Color[],against: Color,order: "asc" | "desc"): Color[]` _colors_ **The array of colors to sort** _order_ **The expected order of arrangement. Either 'asc' or 'desc'. Default is ascending ('asc')** @@ -632,7 +632,7 @@ The default color space for these utilities is LCH. #### getNearestHue **Parameters:** -(color: Color,colors: Color[],colorSpace?: HueColorSpaces): number +`(color: Color,colors: Color[],colorSpace?: HueColorSpaces): number` _color_ **The color to use its hue value as the minuend.** _colors_ **The collection of colors to compare against.** _colorSpace_ **The mode color space to perform the computation in.** @@ -658,7 +658,7 @@ console.log(getNearestHue('lime', sample, 'lch')) #### getFarthestHue **Parameters:** -(color: Color,colors: Color[],colorSpace?: HueColorSpaces): number +`(color: Color,colors: Color[],colorSpace?: HueColorSpaces): number` _color_ **The color to use its hue value as the minuend.** _colors_ **The collection of colors to compare against.** _colorSpace_ **The mode color space to perform the computation in.** @@ -681,7 +681,7 @@ console.log(getFarthestHue('lime', sample, 'lch')) #### minHue **Parameters:** -(colors: Color[],colorSpace?: HueColorSpaces,colorObj = false): number | { factor: number; color: Color } +`(colors: Color[],colorSpace?: HueColorSpaces,colorObj = false): number | { factor: number; color: Color }` _colors_ **The array of colors to query the color with the smallest hue value.** _colorSpace_ **The mode color space to perform the computation in.** _colorObj_ **Optional boolean that makes the function return a custom object with factor (hue) and name of the color as keys. Default is false.** @@ -706,7 +706,7 @@ console.log(minHue(sample, 'lch')) #### maxHue **Parameters:** -(colors: Color[],colorSpace?: HueColorSpaces,colorObj = false): number | { factor: number; color: Color } +`(colors: Color[],colorSpace?: HueColorSpaces,colorObj = false): number | { factor: number; color: Color }` _colors_ **The array of colors to query the color with the largest hue value.** _colorSpace_ **The mode color space to perform the computation in.** _colorObj_ **Optional boolean that makes the function return a custom object with factor (hue) and name of the color as keys. Default is false.** @@ -730,7 +730,7 @@ console.log(maxHue(sample, 'lch')) #### getNearestChroma **Parameters:** -(color: Color,colors: Color[],colorSpace?: HueColorSpaces): number +`(color: Color,colors: Color[],colorSpace?: HueColorSpaces): number` _color_ **The color to use its saturation value as the minuend.** _colors_ **The collection of colors to compare against.** _colorSpace_ **The mode color space to perform the computation in.** @@ -755,7 +755,7 @@ console.log(getNearestChroma('lime', sample, 'lch')) #### getFarthestChroma **Parameters:** -(color: Color,colors: Color[],colorSpace?: HueColorSpaces): number +`(color: Color,colors: Color[],colorSpace?: HueColorSpaces): number` _color_ **The color to use its saturation value as the minuend.** _colors_ **The collection of colors to compare against.** _colorSpace_ **The mode color space to perform the computation in.** @@ -780,7 +780,7 @@ console.log(getFarthestChroma('lime', sample, 'lch')) #### minChroma **Parameters:** -(colors: Color[],colorSpace?: HueColorSpaces,colorObj = false): number | { factor: number; color: Color } +`(colors: Color[],colorSpace?: HueColorSpaces,colorObj = false): number | { factor: number; color: Color }` _colors_ **The array of colors to query the color with the smallest saturation/chroma value.** _colorSpace_ **The mode color space to perform the computation in.** _colorObj_ **Optional boolean that makes the function return a custom object with factor (saturation) and name of the color as keys. Default is false.** @@ -803,6 +803,7 @@ console.log(minChroma(sample, 'lch')) #### maxChroma +`(colors: Color[],colorSpace?: HueColorSpaces,colorObj = false): number | { factor: number; color: Color }` **Parameters:** _colors_ **The array of colors to query the color with the smallest saturation/chroma value.** _colorSpace_ **The mode color space to perform the computation in.** diff --git a/data/blog/colors.md b/data/blog/colors.md index ddefa655..0ad87744 100644 --- a/data/blog/colors.md +++ b/data/blog/colors.md @@ -41,7 +41,7 @@ console.log(red('900')); ### The _colors_ utility **Parameters:** -(shade: keyof HueMap,val: keyof ScaleValues): Color | Color[] +`(shade: keyof HueMap,val: keyof ScaleValues): Color | Color[]` _shade_ **Any shade in the default TailwindCSS palette e.g amber,blue.** _val_ **Any value from 100 to 900 in increments of 100 e.g "200".** diff --git a/data/blog/core-utilities.md b/data/blog/core-utilities.md index 2dc358ce..3f1eb81d 100644 --- a/data/blog/core-utilities.md +++ b/data/blog/core-utilities.md @@ -10,7 +10,7 @@ canonicalUrl: https://prjctimg.github.io/huetiful/api/core-utilities #### alpha **Parameters:** -(color: Color, value?: number): Color | number +`(color: Color, value?: number): Color | number` _color_ **The color with the targeted opacity/alpha channel.** _value_ **The value to apply to the opacity channel. The value is between [0,1]** @@ -41,7 +41,7 @@ console.log(myColor) #### darken **Parameters:** -(color: Color, amount: number): Color +`(color: Color, amount: number): Color` _color_ **The color to darken.** _amount_ **The amount to darken with. Also supports expressions as strings e.g darken("#fc23a1","\*0.5")** @@ -63,7 +63,7 @@ console.log(darken('#a1bd2f', 0.2)) #### getChannel **Parameters** -(mc: string) => (color: Color): number +`(mc: string) => (color: Color): number` _mc_ **The mode and channel to be retrieved. For example "rgb.b" will return the value of the blue channel in the RGB color space of that color.** _color_ **The color being queried.** @@ -85,7 +85,7 @@ console.log(getChannel('rgb.g')('#a1bd2f')) #### getLuminance **Parameters:** -(color: Color): number +`(color: Color): number` _color_ **The color to query.** **Returns:** @@ -104,7 +104,7 @@ console.log(getLuminance('#a1bd2f')) #### setLuminance **Parameters:** -(color: Color, lum: number):Color +`(color: Color, lum: number):Color` _color_ **The color to set luminance** _lum_ **The amount of luminance to set. The value range is normalised between [0,1].** @@ -126,7 +126,7 @@ console.log(getLuminance(myColor)) #### getTemp **Parameters:** -(color: Color): number +`(color: Color): number` _color_ **The color to query its temperature value** **Returns:** @@ -147,7 +147,7 @@ console.log(getTemp('#a1bd2f')) #### setChannel **Parameters:** -(mc: string) => (color: Color, value: number | string): Color +`(mc: string) => (color: Color, value: number | string): Color` _color_ **Any recognizable color token.** _mc_ **The mode and channel to work with. For example 'rgb.b'.** _value_ **The value to set on the queried channel. Also supports expressions as strings e.g set('lch.c)("#fc23a1","\*0.5")** @@ -167,7 +167,7 @@ import { setChannel } from 'huetiful-js' #### temp2Color **Parameters:** -(kelvin: number,hex=false): Color +`(kelvin: number,hex=false): Color` _kelvin_ **The number of Kelvins. From 0 to 30,000 .** _hex_ **Optional parameter to either return an RGB or hexadecimal.** diff --git a/data/blog/palette-utilities.md b/data/blog/palette-utilities.md index 84abd6c2..8dfae204 100644 --- a/data/blog/palette-utilities.md +++ b/data/blog/palette-utilities.md @@ -10,7 +10,7 @@ canonicalUrl: https://prjctimg.github.io/huetiful/api/palettes #### base **Parameters:** -(scheme: palette) => (color: Color, hex = false): Color[] +`(scheme: palette) => (color: Color, hex = false): Color[]` _scheme_ Any classic color scheme either "analogous"|"triadic"|"tetradic"|"complementary"|"splitComplementary" _hex_ Optional boolen to return lch color objects or hex codes in the result array. Default is false which returns LCH color objects. @@ -29,7 +29,7 @@ Generates a randomised classic color scheme from a single base color. #### earthtone **Parameters:** -(color: Color, tone: keyof earthtones, num = 1): Color[] +`(color: Color, tone: keyof earthtones, num = 1): Color[]` _color_ The color to interpolate an earth tone with. _tone_ The earthtone to interpolate with. _num_ The number of iterations to produce from the color and earthtone. @@ -49,7 +49,7 @@ Creates a scale of a spline based interpolation between an earthtone and a color #### pastel **Parameters:** -(color: Color, hex = true): Color +`(color: Color, hex = true): Color` _color_ The color to return a pastel variant of. _hex_ Pass in true to return an 8-character hex code else it will return an HSV color object. @@ -70,13 +70,13 @@ We can also create a palette of hue shifted colors from a single base color. The #### hueShift **Parameters:** -(color: Color, +`(color: Color, opts = { minLightness, maxLightness, hueStep, num },hex = true -): Color[] +): Color[]` _color_ **The color to use as the base of the hueshift. Colors are internally converted to LCH.** _minLightness_ **Minimum lightness value (range 0-100).** _maxLightness_ **Maximum lightness value (range 0-100).** @@ -113,7 +113,7 @@ console.log(hueShiftedPalette); #### pairedScheme **Parameters:** -(color: Color,hueStep: number,num: number, via: tone,overrides:{}): Color[] +`(color: Color,hueStep: number,num: number, via: tone,overrides:{}): Color[]` _color_ The color to return a paired color scheme from. _via_ The tone to interpolate through (either white or black). Default is white. _hueStep_ The value to increment the base color's hue channel with. @@ -129,7 +129,7 @@ Creates a scheme that consists of a base color that is incremented by a hueStep #### getHue **Parameters:** -(color: Color): string +`(color: Color): string` **Returns:** The name of the hue family for example red or green.