Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/artiphishle/ankh-hooks
Ankhorage Hooks
https://github.com/artiphishle/ankh-hooks
Last synced: 2 months ago
JSON representation
Ankhorage Hooks
- Host: GitHub
- URL: https://github.com/artiphishle/ankh-hooks
- Owner: artiphishle
- License: mit
- Created: 2024-07-26T06:10:29.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-09-12T04:40:00.000Z (4 months ago)
- Last Synced: 2024-09-12T14:14:16.482Z (4 months ago)
- Language: TypeScript
- Size: 169 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Ankhorage Hooks
This is a library of hooks (functions) covering different categories.
## Color
Collection of hooks related to color
### useColorContrast()
By default the contrast will be rounded to 2 decimals but you can change this as a third param.
```ts
const { useColorContrastFromHex } = useColorContrast();useColorContrastFromHex("#767676", "#ffffff");
// Output: 4.54useColorContrastFromHex("#abcdef", "#fbcdaa", 4);
// Output: 1.1341
```### useColorConverter()
Documentation to follow
### useColorHelper()
Documentation to follow
### useColorHues()
Documentation to follow
### useColorLuminance()
Documentation to follow
### useColorPalette()
Documentation to follow
### useColorParser()
Documentation to follow
### useColorValidator()
Documentation to follow
## MDD
Metric driven design
### useError()
Enable logging will `useLogging` to either write a log to a provide API (C)rud Create function or if not provided `console.log()`.
```ts
const { useFatalError } = useError();useFatalError("Something went wrong!", {enableLogging: true});"
```### useLogging()
```ts
const { writeLog } = useAnkhLogging();
```## Static
Static file handling
### useSvg()
Dynamically load an SVG icon
```ts
const SvgComponent = useSvg("house");
```