Skip to content

Commit

Permalink
v1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
MAHcodes committed Apr 19, 2024
1 parent 199c082 commit 7f31aa3
Show file tree
Hide file tree
Showing 17 changed files with 366 additions and 954 deletions.
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
<img src="https://raw.githubusercontent.com/catppuccin/catppuccin/main/assets/misc/transparent.png" height="30" width="0px"/>
</h3>

<p align="center">
<a href="https://hex.pm/packages/catppuccin"><img alt="Package Version" src="https://img.shields.io/hexpm/v/catppuccin?style=for-the-badge&color=7287fd&colorA=363a4f"></a>
<a href="https://hexdocs.pm/catppuccin/"><img alt="Hex Docs" src="https://img.shields.io/badge/hex-docs-ffaff3?style=for-the-badge&color=c6a0f6&colorA=363a4f"></a>
</p>

<p align="center">
<a href="https://github.com/MAHcodes/catppuccin/stargazers"><img src="https://img.shields.io/github/stars/MAHcodes/catppuccin?colorA=363a4f&colorB=b7bdf8&style=for-the-badge"></a>
<a href="https://github.com/MAHcodes/catppuccin/issues"><img src="https://img.shields.io/github/issues/MAHcodes/catppuccin?colorA=363a4f&colorB=f5a97f&style=for-the-badge"></a>
Expand All @@ -20,32 +25,28 @@ gleam add catppuccin
## 🚀 Usage

```gleam
import catppuccin/mocha
import catppuccin/frappe
import gleam/io
import gleam_community/colour
pub fn main() {
mocha.name
frappe.name
|> io.debug
// "Mocha"
// "Frappé"
mocha.mauve().name
frappe.mauve().name
|> io.debug
// "Mauve"
mocha.mauve().colour
frappe.mauve().colour
|> colour.to_rgba
|> io.debug
// #(0.796078431372549, 0.6509803921568628, 0.9686274509803922, 1.0)
// #(0.792156862745098, 0.6196078431372549, 0.9019607843137255, 1.0)
mocha.mauve().colour
frappe.mauve().colour
|> colour.to_css_rgba_string
|> io.debug
// rgba(79.61%,65.1%,96.86%,1.0)
mocha.mauve().rgb.r
|> io.debug
// 203
// "rgba(79.22%,61.96%,90.2%,1.0)"
}
```

Expand All @@ -56,18 +57,17 @@ pub fn main() {

## 🛠️ Development

This project uses [palette.json](https://raw.githubusercontent.com/catppuccin/palette/main/palette.json) to generate library files in the `lib` directory.
The project under `codegen` directory is used to generate library files based on the contents of [palette.json](https://raw.githubusercontent.com/catppuccin/palette/main/palette.json).

1. Clone this repository locally
2. Run the following command to generate files:

2. Cd to the `codegen` directory
3. Run the following command to generate files:
```sh
gleam run
```
3. Format the generated code in `lib/src`:

4. Replace the generated files
```sh
gleam format lib/src
mv -iv catppuccin/* ../src/catppuccin
```

## 💝 Thanks to
Expand Down
File renamed without changes.
File renamed without changes.
20 changes: 8 additions & 12 deletions lib/README.md → codegen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,28 @@
gleam add catppuccin
```
```gleam
import catppuccin/mocha
import catppuccin/frappe
import gleam/io
import gleam_community/colour
pub fn main() {
mocha.name
frappe.name
|> io.debug
// "Mocha"
// "Frappé"
mocha.mauve().name
frappe.mauve().name
|> io.debug
// "Mauve"
mocha.mauve().colour
frappe.mauve().colour
|> colour.to_rgba
|> io.debug
// #(0.796078431372549, 0.6509803921568628, 0.9686274509803922, 1.0)
// #(0.792156862745098, 0.6196078431372549, 0.9019607843137255, 1.0)
mocha.mauve().colour
frappe.mauve().colour
|> colour.to_css_rgba_string
|> io.debug
// rgba(79.61%,65.1%,96.86%,1.0)
mocha.mauve().rgb.r
|> io.debug
// 203
// "rgba(79.22%,61.96%,90.2%,1.0)"
}
```

Expand Down
25 changes: 25 additions & 0 deletions codegen/gleam.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name = "catppuccin"
version = "1.0.0"

# Fill out these fields if you intend to generate HTML documentation or publish
# your project to the Hex package manager.
#
# description = ""
# licences = ["Apache-2.0"]
# repository = { type = "github", user = "username", repo = "project" }
# links = [{ title = "Website", href = "https://gleam.run" }]
#
# For a full reference of all the available options, you can have a look at
# https://gleam.run/writing-gleam/gleam-toml/.

[dependencies]
gleam_stdlib = ">= 0.34.0 and < 2.0.0"
gleam_httpc = ">= 2.2.0 and < 3.0.0"
gleam_http = ">= 3.6.0 and < 4.0.0"
gleam_json = ">= 1.0.0 and < 2.0.0"
simplifile = ">= 1.7.0 and < 2.0.0"
glormat = ">= 1.0.0 and < 2.0.0"
gleam_community_colour = ">= 1.4.0 and < 2.0.0"

[dev-dependencies]
gleeunit = ">= 1.0.0 and < 2.0.0"
10 changes: 10 additions & 0 deletions lib/manifest.toml → codegen/manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,24 @@
# You typically do not need to edit this file

packages = [
{ name = "filepath", version = "1.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "filepath", source = "hex", outer_checksum = "EFB6FF65C98B2A16378ABC3EE2B14124168C0CE5201553DE652E2644DCFDB594" },
{ name = "gleam_community_colour", version = "1.4.0", build_tools = ["gleam"], requirements = ["gleam_json", "gleam_stdlib"], otp_app = "gleam_community_colour", source = "hex", outer_checksum = "795964217EBEDB3DA656F5EB8F67D7AD22872EB95182042D3E7AFEF32D3FD2FE" },
{ name = "gleam_http", version = "3.6.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_http", source = "hex", outer_checksum = "8C07DF9DF8CC7F054C650839A51C30A7D3C26482AC241C899C1CEA86B22DBE51" },
{ name = "gleam_httpc", version = "2.2.0", build_tools = ["gleam"], requirements = ["gleam_http", "gleam_stdlib"], otp_app = "gleam_httpc", source = "hex", outer_checksum = "CF76C71002DEECF6DC5D9CA83D962728FAE166B57926BE442D827004D3C7DF1B" },
{ name = "gleam_json", version = "1.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib", "thoas"], otp_app = "gleam_json", source = "hex", outer_checksum = "8B197DD5D578EA6AC2C0D4BDC634C71A5BCA8E7DB5F47091C263ECB411A60DF3" },
{ name = "gleam_stdlib", version = "0.36.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "C0D14D807FEC6F8A08A7C9EF8DFDE6AE5C10E40E21325B2B29365965D82EB3D4" },
{ name = "gleeunit", version = "1.1.2", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleeunit", source = "hex", outer_checksum = "72CDC3D3F719478F26C4E2C5FED3E657AC81EC14A47D2D2DEBB8693CA3220C3B" },
{ name = "glormat", version = "1.0.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "glormat", source = "hex", outer_checksum = "9328C6CB14E562653BF7B4E910138351A39F05444D9A6D8960EA0376B7A3AADC" },
{ name = "simplifile", version = "1.7.0", build_tools = ["gleam"], requirements = ["filepath", "gleam_stdlib"], otp_app = "simplifile", source = "hex", outer_checksum = "1D5DFA3A2F9319EC85825F6ED88B8E449F381B0D55A62F5E61424E748E7DDEB0" },
{ name = "thoas", version = "0.4.1", build_tools = ["rebar3"], requirements = [], otp_app = "thoas", source = "hex", outer_checksum = "4918D50026C073C4AB1388437132C77A6F6F7C8AC43C60C13758CC0ADCE2134E" },
]

[requirements]
gleam_community_colour = { version = ">= 1.4.0 and < 2.0.0"}
gleam_http = { version = ">= 3.6.0 and < 4.0.0" }
gleam_httpc = { version = ">= 2.2.0 and < 3.0.0" }
gleam_json = { version = ">= 1.0.0 and < 2.0.0" }
gleam_stdlib = { version = ">= 0.34.0 and < 2.0.0" }
gleeunit = { version = ">= 1.0.0 and < 2.0.0" }
glormat = { version = ">= 1.0.0 and < 2.0.0" }
simplifile = { version = ">= 1.7.0 and < 2.0.0" }
Loading

0 comments on commit 7f31aa3

Please sign in to comment.