Skip to content

Commit

Permalink
Edited documentation source files
Browse files Browse the repository at this point in the history
  • Loading branch information
prjctimg committed Oct 10, 2023
1 parent 70366f4 commit aa1c68e
Show file tree
Hide file tree
Showing 40 changed files with 9,391 additions and 2,112 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ module.exports = {
'react/react-in-jsx-scope': 'off',
'react/prop-types': 0,
'no-unused-vars': 0,
'react/no-unescaped-entities': true,
'react/no-unescaped-entities': 0,
},
}
7 changes: 0 additions & 7 deletions README.md

This file was deleted.

17 changes: 17 additions & 0 deletions components/CodeMirror.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import CodeMirror from '@uiw/react-codemirror'

function CodeMirrorComponent({ data = '' }) {
return (
<CodeMirror
value={`${data}`}
height="200px"
basicSetup={{
foldGutter: true,
dropCursor: false,
allowMultipleSelections: false,
indentOnInput: true,
}}
/>
)
}
export default CodeMirrorComponent
9 changes: 0 additions & 9 deletions data/blog/about-types.mdx

This file was deleted.

19 changes: 10 additions & 9 deletions data/blog/achromatic.mdx
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
---
title: Working with achromatic colors
eleventyNavigation:
key: Working with achromatic colors
title: Working with achromatic colors.
date: '2023-09-28'
draft: false
summary: Utility for working with grays or achromatic colors and how to differentiate them from chromatic colors programmatically.
layout: PostSimple
canonicalUrl: https://prjctimg.github.io/huetiful/api/achromatic
---

These are a subtype of colors that have no _hue_. Also known as grays, these colors can be found by interpolating black and white.


These are a subtype of colors that have no *hue*. Also known as grays, these colors can be found by interpolating black and white.

We can use the *isAchromatic* utility to check if a color is achromatic or not.
We can use the _isAchromatic_ utility to check if a color is achromatic or not.

**Parameters:**
(color:Color):boolean
Expand Down Expand Up @@ -66,7 +67,7 @@ let f = interpolate(["black", "white"]);
let grays = map(samples(12), (c) => formatHex8(f(c)));
console.log(map(grays, isAchromatic));

//
//
[ false, true, true,
true, true, true,
true, true, true,
Expand All @@ -75,6 +76,6 @@ console.log(map(grays, isAchromatic));

```

In the above code, we used *isAchromatic* against different samples of achromatic as well as chromatic colors. The *samples* array contained chromatic colors whilst `grays` holds the achromatic colors. Notice that at the last and first index when we tested for achromatic colors we had `false` values instead of *true*. This is because pure white/black are not achromatic.
In the above code, we used _isAchromatic_ against different samples of achromatic as well as chromatic colors. The _samples_ array contained chromatic colors whilst `grays` holds the achromatic colors. Notice that at the last and first index when we tested for achromatic colors we had `false` values instead of _true_. This is because pure white/black are not achromatic.

> For a color to be classified as being achromatic, it needs a falsy value on the **saturation** / **chroma** channel such as 0, **NaN** or **undefined**. This is because the `hue` depends on the **saturation** channel to be true or not be gray. This means that altering the **hue** or **lightness** channel whilst **saturation** is falsy will only return a gray color and black or white (at the extreme ends of the **lightness** channel) .
Loading

0 comments on commit aa1c68e

Please sign in to comment.