Skip to content

Commit

Permalink
v3.0.0 (#192)
Browse files Browse the repository at this point in the history
* 📦 ci(formatter.yml): added workflow to lint and format code on push

* 📝 docs(readme.md): fixed attributions

* 📝 docs(navbar.njk): vavbar now changges flex direction on large screens

* 🧹 chore(docs): added more fields to the index.html file and added docsify plugins

* 🧹 chore(docs): modified the docs source files and assets

added favicons and progressive web app support. added docsify plugins. imporoved folder structure
and overall seo

* ✨ feat(sortby): refactored the module to have only one function (feat #190)

all the smaller functions have been merged into one function which can be switched through
specifying the type of factor to use. not yet tested but looks stable enough for a commit

BREAKING CHANGE: The against and colorspace parameters are now specified as options. the function
takes a string or the factor as the first argument instead of a collection

feat #190

* ✨ feat(filterby): merged all the sub functionas into one function (feat #190)

all sub functions are now accessible via specifying the factor to use as a filtering criteria

BREAKING CHANGE: this function takes a string as the first argument now and factor specific
parameters are now accessible as options on the second call which takes the collection

feat #190

* ✨ feat(stats): merged all stats functions into one function (feat #191)

all previous functions that returned the smallest/largest factor from collections and other similar
related functionality are now under one function that simply returns an object with all the stats in
a more compact way

BREAKING CHANGE: there's no more getFarthestHue or similar functions. all factors about a collection
asre now being returned at once instead of redundantly pilling up function calls you can just get
the data you need  from a single object

feat #191

* 📈 perf(helpers): improved collection detection during mapping (feat: #193)

feat: #193

* 🧹 chore(src): split all modules into single exports for easier debugging, testing and maintenance

* 🧹 chore(wrappers.js): fixed broken imports

* 🧹 chore: fixed broken imports,cleaned documentation file structure and updated files in configs

* 🧹 chore: fixed types output

* 📦 ci: readded build scripts to docs

* ✨ feat(achromatic.js): achromatic now checks if a color is gray by comparing rgb channel values

* ♻️ refactor(achromatic.js): created small helper for checking falsy cases on l and c channels

* 🧹 chore(alpha.js): proofread the documentation and removed the default parameter for color

* 🧹 chore(colors.js): updated the documentation

* ✨ feat(complimentary.js): removed the colorspace parameter. now uses jch by default

* 🧹 chore(lightness.js): refacored darken and brighten by extracting a base function

* 🧹 chore(deficiency.js): updated documentation and made the kind parameter case insensitive

* 🧹 chore(discover.js): updated the documentation

* 🧹 chore(earthtone.js): fixed the documentation

* 🧹 chore(family.js): fixed the documentation

* 🧹 chore(filterby.js): updated the documentation and made the factor parameter case insensitive

* 🧹 chore(get.js): updated the documentation

* 🧹 chore(hueshift.js): updated the documentation

* 🧹 chore(index.js): updated library exports

* ✨ feat: simplified all parameter signatures

All functions that can take an overrides or options object now take them as a single object.

* 🧹 chore(wrappers.js): fixed class methods by updating docs and related functions

* chore: release 3.0.0

release-as: 3.0.0

* 📦 ci(wiki-sync.yml): added workflow for synchronising wiki source docs with direct wiki edits

* 🐛 fix(src): removed incorrect incorrect invocation of token() which caused type rrors

* ✨ feat(achromatic.js): check for achromatic colors using the rgb colorspace

* 🧪 test(spec): refactored tests to match the new api

* 🧹 chore(mc.js): found missing else clause making the function return undefined

* 🧹 chore: simplified codebase and fixed a lot of bugs

* 📝 docs(achromatic.js): fixed documentation
  • Loading branch information
prjctimg committed May 9, 2024
1 parent 347a204 commit a26b581
Show file tree
Hide file tree
Showing 357 changed files with 16,828 additions and 49,772 deletions.
1 change: 0 additions & 1 deletion .commitlintrc.json

This file was deleted.

8 changes: 3 additions & 5 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,14 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build site
run: |
npm install
- run: |
npm i
npm run docs
cd docs/assets && npm install && npm run deploy
- name: Deploy site
uses: JamesIves/github-pages-deploy-action@v4
with:
# Upload directory with assets
folder: docs/www
folder: docs
branch: gh-pages
clean-exclude: pr-preview
force: false
File renamed without changes.
15 changes: 15 additions & 0 deletions .github/workflows/formatter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
on: push
name: Lint and format code

permissions:
contents: write


jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Lint and format
uses: MarvinJWendt/run-node-formatter@stable
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
2 changes: 1 addition & 1 deletion .github/workflows/issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ jobs:
To claim an issue, please leave a comment that says ".take". If you have any questions, feel free to ping a maintainer.
# For full info on how to contribute, please check out our [contributors guide]().
# For full info on how to contribute, please check out our [contributors guide](https://github.com/xml-wizard/huetiful/blob/main/CONTRIBUTING.md).
11 changes: 4 additions & 7 deletions .github/workflows/preview-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install and Build
if: github.event.action != 'closed' # skips build step if pr is closed

run: |
npm install
- run: |
npm i
npm run docs
cd docs/assets && npm install && npm run deploy
- name: Deploy PR Preview
uses: rossjrw/pr-preview-action@v1.4.7

with:
token: ${{secrets.GH_PAT}}
preview-branch: gh-pages
source-dir: docs/www
source-dir: docs
umbrella-dir: docs/pr-preview
action: auto
17 changes: 8 additions & 9 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,20 @@ name: Mark stale issues and pull requests

on:
schedule:
- cron: '40 8 * * *'
- cron: '00 00 * * 0'

jobs:
stale:

runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write

steps:
- uses: actions/stale@v5
with:
repo-token: ${{ secrets.GH_PAT }}
stale-issue-message: 'Stale issue message'
stale-pr-message: 'Stale pull request message'
stale-issue-label: 'no-issue-activity'
stale-pr-label: 'no-pr-activity'
- uses: actions/stale@v5
with:
repo-token: ${{ secrets.GH_PAT }}
stale-issue-message: 'Stale issue message'
stale-pr-message: 'Stale pull request message'
stale-issue-label: 'no-issue-activity'
stale-pr-label: 'no-pr-activity'
50 changes: 50 additions & 0 deletions .github/workflows/wiki-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Wiki update and sync

on:
push:
branches:
- main
paths:
- '.github/wiki/**'
repository_dispatch:
types: [docs]
gollum:

permissions:
contents: write

env:
GIT_AUTHOR_NAME: Wikibot

jobs:
sync-docs-to-wiki:
runs-on: ubuntu-latest
if: github.event_name == 'gollum'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Sync docs to wiki
uses: newrelic/wiki-sync-action@main
with:
source: ./github/wiki
destination: wiki
token: ${{secrets.GH_PAT}}
gitAuthorName: ${{env.GIT_AUTHOR_NAME}}

sync-wiki-to-docs:
runs-on: ubuntu-latest
if: github.event_name == 'gollum'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{secrets.GH_PAT}}
ref: main
- name: Sync wiki to docs
uses: newrelic/wiki-sync-action@main
with:
source: wiki
destination: ./github/wiki
token: ${{secrets.GH_PAT}}
gitAuthorName: ${{env.GIT_AUTHOR_NAME}}
branch: main
36 changes: 0 additions & 36 deletions .husky/_/husky.sh

This file was deleted.

5 changes: 0 additions & 5 deletions .husky/pre-push

This file was deleted.

14 changes: 0 additions & 14 deletions .versionrc.json

This file was deleted.

4 changes: 2 additions & 2 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,9 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

(c) 2023 Dean Tarisai
(c) 2024 Dean Tarisai & xml-wizard contributors
huetiful-js
-> Open source TypeScript library for general purpose color manipulations.
-> Function oriented JavaScript library for color manipulation

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
67 changes: 19 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,13 @@
![huetiful-logo](/assets/img/logo.svg)

[![Deploy GitHub Pages](https://github.com/xml-wizard/huetiful/actions/workflows/deploy-docs.yml/badge.svg?branch=main)](https://github.com/xml-wizard/huetiful/actions/workflows/deploy-docs.yml)
[![NPM publish 📦](https://github.com/xml-wizard/huetiful/actions/workflows/release-please.yml/badge.svg)](https://github.com/xml-wizard/huetiful/actions/workflows/release-please.yml)
![NPM Downloads](https://img.shields.io/npm/dm/huetiful-js?style=social&logo=npm&link=https%3A%2F%2Fnpmjs.com%2Fpackage%2Fhuetiful-js%20)
![GitHub Repo stars](https://img.shields.io/github/stars/xml-wizard/huetiful?style=social&logo=github)
[![npm minzipped size](https://img.shields.io/bundlephobia/minzip/huetiful-js?style=social)](https://bundlephobia.com/package/huetiful-js)
[![twitter](https://img.shields.io/twitter/follow/deantarisai?style=social)](https://twitter.com/deantarisai)

<img alt='Logo for huetiful-js' src='./docs/assets/img/logo.svg' width='800'>

<p align='center'>
<br>
<br>
<a href="https://huetiful-js.com">📜 API</a>
·
<a href="https://github.com/xml-wizard/huetiful/issues/new?template=---bug-report.md">🐞 Report Bug</a>
·
<a href="https://github.com/xml-wizard/huetiful/issues/new?template=---feature-request.md">🍩 Request Feature</a>
·
<a href="https://github.com/xml-wizard/huetiful/wiki">🧠 Wiki </a>
</p>

<!-- @import "[TOC]" {cmd="toc" depthFrom=2 depthTo=6 orderedList=false} -->

<!-- code_chunk_output -->

- [Description](#description)
- [Features](#features)
- [Installation](#installation)
- [Using a package manager](#using-a-package-manager)
- [In the browser and via CDNs](#in-the-browser-and-via-cdns)
- [Quickstart](#quickstart)
- [Community](#community)
- [Contributing](#contributing)
- [References](#references)

<!-- /code_chunk_output -->

## Description

[huetiful-js](www.huetiful-js.com) is a **small** (~15kB) & **fast** library for color manipulation written in JavaScript.
[huetiful-js](www.huetiful-js.com) is a **small** (~10kB) & **fast** library for color manipulation written in JavaScript.

It is function oriented and borrows a lot of its features from color theory but tries to hide away the science from the developer.

Expand All @@ -47,15 +17,14 @@ It uses [Culori](https://culorijs.org/api/) under the hood which provides access

### Features

- [Filtering collections of colors]() by using the values of their properties as ranges. For example `distance` against a comparison color and `luminance`.
- [Sorting collections of colors in]() by their properties. For example using `saturation` or `hue` in either descending or ascending order
- [Creating custom palettes and color scales]()
- [Manipulating individual color tokens]() for example setting and querying properties
- [Predicate functions for determining the properties of a color]() e.g chromaticity or overtone.
- [Calculating values of central tendency and other statistical values]() from collections of colors
- [Wrapping collections of colors/individual color tokens]() similar to Lodash's `_.chain` utility allowing method chaining before returning our final output.
- [Color maps for Colorbrewer, TailwindCSS and CSS named colors]()
- [Converting colors across different types]() including numbers, strings (all CSS parseable string represantations of color), plain objects, arrays and even boolean values
- [Filtering collections of colors](https://huetiful-js.com/api/filterBy) by using the values of their properties as ranges. For example `distance` against a comparison color and `luminance`.
- [Sorting collections of colors](https://huetiful-js.com/api/sortBy) by their properties. For example using `saturation` or `hue` in either descending or ascending order
- [Creating custom palettes and color scales](https://huetiful-js.com/api/generators)
- [Manipulating individual color tokens](https://huetiful-js.com/api/utils) for example setting and querying properties as well as querying their properties i.e chromaticity.
- [Calculating values of central tendency and other statistical values](https://huetiful-js.com/api/stats) from collections of colors
- [Wrapping collections of colors/individual color tokens](https://huetiful-js.com/api/wrappers) similar to Lodash's `_.chain` utility allowing method chaining before returning our final output.
- [Color maps for Colorbrewer, TailwindCSS and CSS named colors](https://huetiful-js.com/api/colors)
- [Converting colors across different types](https://huetiful-js.com/api/converterters) including numbers, strings (all CSS parseable string represantations of color), plain objects, arrays and even boolean values

## Installation

Expand All @@ -72,7 +41,7 @@ npm i huetiful-js
Or:

```bash
yarn install huetiful-js
yarn add huetiful-js
```

### In the browser and via CDNs
Expand All @@ -95,23 +64,25 @@ Or load the library as a UMD glabal (`huetiful`) in your HTML file using a `<scr

## Quickstart

[See the Quickstart here](https://huetiful-js.com/api)
[See the Quickstart here](https://huetiful-js.com/quickstart)

## Community

[See the discussions](https://github.com/xml-wizard/huetiful/discussions) and just say hi, or share a coding meme (whatever breaks the ice🏔️)

## Contributing

This project is fully open source! Contributions of any kind are greatly appreciated! See🔍 the [contributing page on the documentation site](https://huetiful-js.com/contributing)) file for more information on how to get started.
This project is fully open source! Contributions of any kind are greatly appreciated! See🔍 the [contributing page on the documentation site](https://huetiful-js.com/contributing) file for more information on how to get started.

### References

#### References
This project is a result of open source resources from many places all over the Internet.

This project is a result of open source resources from many places all over the Internet. [See the references here](https://huetiful-js.com/references)
[See some of the references here](https://huetiful-js.com/references)

<pre>
License ⚖️

© 2024, <a href="https://github.com/xml-wizard">xml-wizard</a>
© 2024, <a href="https://deantarisai.me">Dean Tarisai</a> & <a href="https://github.com/xml-wizard">xml-wizard contributors</a>
Released under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache 2.0</a> license.</h5>
🧪 & 🔬 with 🥃 in Crowhill,ZW</pre>

0 comments on commit a26b581

Please sign in to comment.