catppuccin / catppuccin/rust

Color conversion does not work

Open
#76 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
147
Forks
14
PR merge metrics
No merged PRs in 30d

Description

This is my dependencies:
```toml
[dependencies]
bevy = { version = "0.19", default-features = false, features = ["ui", "2d"] }
catppuccin = { version = "2.8.0", features = ["bevy"] }
```

This conversion is defined in the library:
https://github.com/catppuccin/rust/blob/9c5fc24ad69a035e91287fa124f28ec140573b3d/src/lib.rs#L631-L648

Yet, when I try to convert a color, this happens:
```
error[E0277]: the trait bound `bevy::bevy_color::Color: From` is not satisfied
--> src/main.rs:42:25
|
42 | BackgroundColor(bevy::prelude::Color::from(catppuccin::PALETTE.mocha.colors.base)),
| ^^^^^^^^^^^^^^^^^^^^ the trait `From` is not implemented for `bevy::bevy_color::Color`
|
= help: `bevy::bevy_color::Color` implements trait `From`:
From
From
From
From
From
From
From
From
and 2 others
= note: there are multiple different versions of crate `bevy_color` in the dependency graph
= help: you can use `cargo tree` to explore your dependency tree

For more information about this error, try `rustc --explain E0277`.
error: could not compile `game` (bin "game") due to 1 previous error
```

As for the reason, I think it has something to do with a version conflict with me using v0.19 and catppuccin using v0.18 of bevy. If not because of that, that's a separate issue that causes build times to be doubled. I don't know if this is the true cause, I haven't investigated.

Contributor guide

Open the contributing guide

Research direction

Reproduce the conversion from src/main.rs at line 42 using the dependencies in Cargo.toml, then run cargo tree to inspect the duplicate bevy_color versions. Read the conversion implementation in src/lib.rs around lines 631-648 and verify whether the library supports Bevy 0.19; done means the example compiles without the trait error or conflicting Bevy versions.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.