Skip to content

Commit

Permalink
Wrapped all parameters in pre tags.
Browse files Browse the repository at this point in the history
  • Loading branch information
prjctimg committed Oct 11, 2023
1 parent e3fcaaf commit 5858616
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 39 deletions.
4 changes: 4 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"MD013": false,
"MD001":false
}
2 changes: 1 addition & 1 deletion data/blog/achromatic.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:**
Expand Down
45 changes: 23 additions & 22 deletions data/blog/array-methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -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].**
Expand All @@ -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.**
Expand Down Expand Up @@ -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.**
Expand Down Expand Up @@ -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.**
Expand Down Expand Up @@ -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.**
Expand Down Expand Up @@ -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.**
Expand Down Expand Up @@ -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.**
Expand Down Expand Up @@ -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')**

Expand Down Expand Up @@ -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')

Expand Down Expand Up @@ -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.**
Expand Down Expand Up @@ -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')**

Expand Down Expand Up @@ -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')**

Expand Down Expand Up @@ -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')**
Expand Down Expand Up @@ -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')**

Expand Down Expand Up @@ -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.**
Expand All @@ -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.**
Expand All @@ -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.**
Expand All @@ -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.**
Expand All @@ -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.**
Expand All @@ -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.**
Expand All @@ -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.**
Expand All @@ -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.**
Expand Down
2 changes: 1 addition & 1 deletion data/blog/colors.md
Original file line number Diff line number Diff line change
Expand Up @@ -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".**
Expand Down
16 changes: 8 additions & 8 deletions data/blog/core-utilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]**

Expand Down Expand Up @@ -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")**

Expand All @@ -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.**

Expand All @@ -85,7 +85,7 @@ console.log(getChannel('rgb.g')('#a1bd2f'))
#### getLuminance

**Parameters:**
(color: Color): number
`(color: Color): number`
_color_ **The color to query.**

**Returns:**
Expand All @@ -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].**

Expand All @@ -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:**
Expand All @@ -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")**
Expand All @@ -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.**

Expand Down
14 changes: 7 additions & 7 deletions data/blog/palette-utilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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.
Expand All @@ -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.

Expand All @@ -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).**
Expand Down Expand Up @@ -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.
Expand All @@ -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.
Expand Down

0 comments on commit 5858616

Please sign in to comment.