Giter Club home page Giter Club logo

palette's Introduction

Logo
Catppuccin Palettes

Usage

Node

Get the NPM package:

npm install @catppuccin/palette
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");
});

Deno

The library gets published to deno.land/x/catppuccin.

import { flavors, flavorEntries } from "https://deno.land/x/catppuccin/mod.ts";
import { bgRgb24 } from "https://deno.land/std/fmt/colors.ts";

// 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(bgRgb24(`  ${hex}  `, { ...rgb }), colorName, accent);
  });
  console.log("\n");
});

Other available formats

Graphics editors

Please use the respective files in the latest GitHub Release:

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

 

Copyright © 2021-present Catppuccin Org

palette's People

Contributors

andreasgrafen avatar angelofallars avatar backwardspy avatar cattokomo avatar catuhana avatar elkrien avatar ghostx31 avatar gingeh avatar github-actions[bot] avatar hibixby avatar isabelroses avatar nekowinston avatar nyxkrage avatar pascall-de-creator avatar pocco81 avatar razimantv avatar rhys-t avatar roootthefox avatar rubyowo avatar sakkke avatar sgoudham avatar simpleauthority avatar stonks3141 avatar thismoon avatar uhidontkno avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

palette's Issues

Include flavour emojis as part of the `palette.json`

The following emojis: 🌻, 🪴, 🌺 and 🌿 are tied to Latte, Frappé, Macchiato and Mocha. It'd be nice to ship them as part of the palette.json so we can pull them into the language libraries and whiskers.

Mostly raising this because I've seen the following whiskers v2 code in dark-reader and github-readme-stats:

{% for id, flavor in flavors %}
<details>
{%- if id == "latte" %}
<summary>🌻 Latte</summary>
{%- elif id == "frappe" %}
<summary>🪴 Frappé</summary>
{%- elif id == "macchiato" %}
<summary>🌺 Macchiato</summary>
{%- else %}
<summary>🌿 Mocha</summary>
{%- endif %}
...

And it'd be nice to reduce that into:

{% for id, flavor in flavors %}
<details>
<summary>{{flavor.emoji}} {{flavor.name}}</summary>
...

Making sense of the current structure/types in the NPM package

I think the typing in the NPM package is pretty suboptimal currently, and also contains errors. (#34)
Also, not really sure about the labels export? In most cases, you would think of the color being part of a flavor, rather than first selecting the color, then the flavor...

Ideally, I'd like to use TS for a nice API with the JSON exports, and generate the JSON programmatically somehow.
We'd only really need 26 colors * 4 flavors, generate the other formats, then export them in the NPM package.

Currently working on this until I'm happy enough with it to raise a PR:
https://gist.github.com/nekowinston/98b363b45e7fbe3256c5ff84a1ed8b07

Add Python support along with JS support.

JavaScript is a great language but NPM has packaging issues at times, mostly with vulnerabilities. Python is another great language which doesn't have these issues. I will be willing to contribute to this to add Python support along with JavaScript support.

Rust: Flavours as enum variants

Motivation

I want to pattern match on the current flavour.

// Fix latte colours
if matches!(flavour, Latte) {
	...
}

Proposed solution

pub enum Flavour {
	Latte,
	...
}

impl Flavour {
	pub fn name(&self) -> &'static str { ... }

	pub fn palette(&self) -> Palette { ... }
	// OR
	pub fn rosewater(&self) -> Colour { ... }
	pub fn flamingo(&self) -> Colour { ... }
	pub fn pink(&self) -> Colour { ... }
	...
}

[Rust]: Naming of the Palette type

Right now we use Palette to refer to colours of each flavours, which after some discussion in the Discord, we ended up with the conclusion that this is the wrong name, as palette usually is used to refer to all 4 flavours as a whole.

The new naming we ended up with is changing Palette to FlavourColours

Seperate projects out to submodules to facilitate better access control

Currently if someone needs to maintain for example the Rust crate, they have to be given access to the entire repo
This is obviously not an ideal situation. A solution to this would be to move each project out into a separate repo and then including them in this repo as a submodules, that way this repo just acts as a sort of hub.

This should probably just be done for future projects being added and perhaps the Rust crate as its still fairly new, as backporting this to the other projects in here, is a pain that probably isn't worth it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.