Skip to content

Commit

Permalink
feat!: complete rewrite (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
nekowinston authored Dec 28, 2023
1 parent 403e0ef commit 5aa876f
Show file tree
Hide file tree
Showing 78 changed files with 2,780 additions and 9,884 deletions.
71 changes: 38 additions & 33 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,49 @@
name: Release Please

on:
push:
branches: [main]

permissions:
contents: write
pull-requests: write

name: release-please

jobs:
release-please:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: google-github-actions/release-please-action@v3
with:
release-type: node
package-name: "@catppuccin/palette"
- name: tag major and minor versions
if: ${{ steps.release.outputs.release_created }}
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git remote add gh-token "https://${{ secrets.GITHUB_TOKEN }}@github.com/google-github-actions/release-please-action.git"
git tag -d v${{ steps.release.outputs.major }} || true
git tag -d v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true
git push origin :v${{ steps.release.outputs.major }} || true
git push origin :v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true
git tag -a v${{ steps.release.outputs.major }} -m "Release v${{ steps.release.outputs.major }}"
git tag -a v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} -m "Release v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}"
git push origin v${{ steps.release.outputs.major }}
git push origin v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}
- uses: actions/checkout@v2
if: ${{ steps.release.outputs.release_created }}
- uses: actions/setup-node@v1
if: ${{ steps.release.outputs.release_created }}
- uses: google-github-actions/release-please-action@v4
id: release
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}

release:
runs-on: ubuntu-latest
needs: release-please
if: ${{ needs.release-please.outputs.release_created }}
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v4

- uses: nekowinston/setup-deno@v1

- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm ci
if: ${{ steps.release.outputs.release_created }}
- run: npm publish
if: ${{ steps.release.outputs.release_created }}
node-version: "lts/*"
cache: "npm"
registry-url: "https://registry.npmjs.org"

- name: Build
run: deno task build

- name: Publish NPM package
working-directory: dist/npm
run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

- name: Upload the palette files
run: |
tar czf catppuccin.tar.gz --directory=dist/palettes/ .
gh release upload ${{ needs.release-please.outputs.tag_name }} catppuccin.tar --clobber
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
dist/
node_modules/
/*.tgz
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.2.0"
}
8 changes: 8 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"deno.enable": true,
"deno.lint": true,
"deno.unstable": false,
"[typescript]": {
"editor.defaultFormatter": "denoland.vscode-deno"
}
}
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ All notable changes to this project will be documented in this file. See [standa
* add LESS palette ([094ebb6](https://github.com/catppuccin/palette/commit/094ebb62a5229ec0ac77bdaf17d427c16c90d8e0))
* add machine-readable palette ([#45](https://github.com/catppuccin/palette/issues/45)) ([df35c12](https://github.com/catppuccin/palette/commit/df35c12c2fc6d2f7a68315a71fe85327199b883c))
* **less:** add accents mixins ([#47](https://github.com/catppuccin/palette/issues/47)) ([baa0469](https://github.com/catppuccin/palette/commit/baa0469b86b4319b26b1f584827924e562924003))
* **npm:** incluse LESS in package ([e78e016](https://github.com/catppuccin/palette/commit/e78e016e01d0144ad3b594357e230bb0eccf3c60))
* **npm:** include LESS in package ([e78e016](https://github.com/catppuccin/palette/commit/e78e016e01d0144ad3b594357e230bb0eccf3c60))

### [0.1.7](https://github.com/catppuccin/palette/compare/v0.1.6...v0.1.7) (2023-03-03)

Expand Down
11 changes: 0 additions & 11 deletions Makefile

This file was deleted.

184 changes: 68 additions & 116 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<h3 align="center">
<img src="https://github.com/raw/catppuccin/catppuccin/main/assets/logos/exports/1544x1544_circle.png" width="100" alt="Logo"/><br/>
<img src="https://github.com/raw/catppuccin/catppuccin/main/assets/misc/transparent.png" height="30" width="0px"/>
Catppuccin Palettes
<img src="https://github.com/raw/catppuccin/catppuccin/main/assets/misc/transparent.png" height="30" width="0px"/> Catppuccin Palettes
<img src="https://github.com/raw/catppuccin/catppuccin/main/assets/misc/transparent.png" height="30" width="0px"/>
</h3>

Expand All @@ -11,135 +10,88 @@
<a href="https://github.com/catppuccin/palette/contributors"><img src="https://img.shields.io/github/contributors/catppuccin/palette?colorA=363a4f&colorB=a6da95&style=for-the-badge"></a>
</p>

<p align="center">
<img src="https://github.com/raw/catppuccin/catppuccin/main/assets/misc/sample.png"/>
</p>

## Available formats

- Development
- [Node Package](#node-package)
- [CSS](#css)
- [Sass](#sass)
- [Tailwind CSS](https://github.com/catppuccin/tailwindcss) (separate repository)
- [Rust](https://github.com/catppuccin/rust) (separate repository)
- [Python](https://github.com/catppuccin/python) (separate repository)
- [Go](https://github.com/catppuccin/go) (separate repository)
- [Java](https://github.com/catppuccin/java) (separate repository)
- [Nim](https://github.com/catppuccin/nim) (separate repository)
- [Lua](https://github.com/catppuccin/lua) (separate repository)
- [V](https://github.com/catppuccin/v) (separate repository)
- Design
- [Affinity](#affinity)
- [Aseprite / LibreSprite](#aseprite--libresprite)
- [Gimp](#gimp)
- [Inkscape](#inkscape)
- [Krita](#krita)
- Colour pickers
- [macOS Color Picker](#macos-color-picker)
- [Sip](#sip)
- Reference
- [PNG](#png)

## Usage

### Node Package

```bash
# npm
npm install @catppuccin/palette
# yarn
yarn add @catppuccin/palette
```

Example: `test.js`

```js
import {variants, labels} from '@catppuccin/palette'

console.log(variants.latte.lavender.hex) // #7287FD
console.log(labels.base.macchiato.hex) // #24273A
```

### CSS
### Node

Import the palettes:
Get the [NPM package](https://www.npmjs.org/package/@catppuccin/palette):

```css
/* directly from the file */
@import "@catppuccin/palette/style";
/* or using unpkg.com */
@import url('https://unpkg.com/@catppuccin/palette/css/catppuccin.css');
```console
npm install @catppuccin/palette
```

Then use them:

```css
body {
color: var(--ctp-mocha-text);
background: var(--ctp-frappe-base);
}
```ts
import { flavors, flavorEntries } from "@catppuccin/palette";
import chalk from "chalk";

// an object containing all catppuccin flavors
console.log(flavors);

// typed helper when iterating flavors
flavorEntries.map(([_, flavor]) => {
console.log(`${flavor.name} is a ${flavor.dark ? "dark" : "light"} theme.`);
console.log(`It has ${flavor.colorEntries.length} colors:`);

// same for the colors
flavor.colorEntries.map(([colorName, { hex, rgb, accent }]) => {
console.log(
chalk.bgRgb(rgb.r, rgb.b, rgb.g)(` ${hex} `),
colorName,
accent
);
});
console.log("\n");
});
```

### Sass

The usage instructions for Sass are documented [here](https://github.com/catppuccin/palette/tree/main/scss), in the `scss` folder.

### Affinity

1. Clone this repository locally
2. Open a file in the `afpalette` folder. If you have multiple Affinity products
installed, you can choose to import it as a System palette
### Deno

### Aseprite / LibreSprite
The library gets published to [`deno.land/x/catppuccin`](https://deno.land/x/catppuccin).

1. Clone this repository locally
2. Open Palette Options
3. Select "Load Palette" from the menu
4. Open a file in `gpl/` in the dialog that appears
```ts
import { flavors, flavorEntries } from "https://deno.land/x/catppuccin/mod.ts";
import { bgRgb24 } from "https://deno.land/std/fmt/colors.ts";

### Gimp
// an object containing all catppuccin flavors
console.log(flavors);

1. Clone this repository locally
2. Navigate to Edit > Preferences > Folders > Palettes in GIMP
3. Select the folder with the 'x' and press "Show file location in the file manager" (the rightmost button)
4. Copy the files in `gpl/` to this folder
// typed helper when iterating flavors
flavorEntries.map(([_, flavor]) => {
console.log(`${flavor.name} is a ${flavor.dark ? "dark" : "light"} theme.`);
console.log(`It has ${flavor.colorEntries.length} colors:`);

### Inkscape

1. Clone this repository locally
2. Navigate to Edit > Preferences > System > User palettes in Inkscape
3. Press the "Open" button next to the folder path
4. Copy the files in `gpl/` to this folder

### Krita

1. Clone this repository locally
2. Navigate to Settings > Dockers > Palette in Krita
3. Open the "Choose Palette" button in the bottom left corner of Palette docker
4. Select "Import a new palette from file"
5. Open a file in `gpl/` in the dialog that appears

### macOS Color Picker
1. Clone this repository locally
2. `cd` into the repo directory
3. Run the following command in terminal, to copy the files into the library:
```bash
cp -r clr/* ~/Library/Colors
// same for the colors
flavor.colorEntries.map(([colorName, { hex, rgb, accent }]) => {
console.log(bgRgb24(` ${hex} `, { ...rgb }), colorName, accent);
});
console.log("\n");
});
```

### Sip
1. Clone this repository locally
2. Open the `sip/` folder
3. Open the `.palette` files, and Sip will import the palettes

## 💝 Thanks to

- [Gingeh](https://github.com/gingeh)
- [TheExistingOne](https://github.com/TheExistingOne)
- [Andreas Grafen](https://github.com/andreasgrafen)
- [Pocco81](https://github.com/Pocco81)
- [winston](https://github.com/nekowinston)
## Other available formats

- Web development
- [CSS](docs/css.md)
- [Sass](docs/sass.md)
- Ports of this library
- [Go](https://github.com/catppuccin/go)
- [Java](https://github.com/catppuccin/java)
- [Lua](https://github.com/catppuccin/lua)
- [Nim](https://github.com/catppuccin/nim)
- [Python](https://github.com/catppuccin/python)
- [Rust](https://github.com/catppuccin/rust)
- [Tailwind CSS](https://github.com/catppuccin/tailwindcss)
- [V](https://github.com/catppuccin/v)

## Graphics editors

Please use the respective files in [the latest GitHub Release](https://github.com/catppuccin/palette/releases/latest):

| Programs | Directory |
| -------------------------------- | ------------ |
| Adobe Suite, Affinity Suite, Sip | `ase/` |
| Aseprite, Gimp, Inkscape, Krita | `gimp/` |
| Procreate | `procreate/` |

&nbsp;

Expand Down
Binary file removed afpalette/catppuccin-frappe.afpalette
Binary file not shown.
Binary file removed afpalette/catppuccin-latte.afpalette
Binary file not shown.
Binary file removed afpalette/catppuccin-macchiato.afpalette
Binary file not shown.
Binary file removed afpalette/catppuccin-mocha.afpalette
Binary file not shown.
Loading

0 comments on commit 5aa876f

Please sign in to comment.