Ogeon / palette

A Rust library for linear color calculations and conversion
Apache License 2.0
752 stars 60 forks source link

Gradient example not working #260

Closed alexfertel closed 3 years ago

alexfertel commented 3 years ago

The gradient example is not working out of the box.

How To Reproduce

I set up a new cargo binary app and copy-pasted the gradient example. It displays a compilation error.

Expected Outcome

The example should work.

Actual Outcome

The example displays a compilation error.

Additional Details

# Cargo.toml
[package]
name = "test"
version = "0.1.0"
edition = "2021"

[dependencies]
palette = "0.6.0"
image = "0.23.14"

Both stable and nightly rust versions (1.55.0 and 1.57.0).

I use Ubuntu 18.04.

Ogeon commented 3 years ago

Hi! Can you please clarify which example this is? Is it the file in palette/examples, the readme examples or from the documentation? It would also help to see the error output.

alexfertel commented 3 years ago

Hello! Sorry I wasn't specific. It's the palette/examples/gradient.rs file.

I will not have my pc available until tonight, but the error happens in lines 50-53 and it's the .into() call. A mismatch between the type happens.

If you point me to where the conversion between those types happens, I am more than happy to contribute.

Ogeon commented 3 years ago

Thanks for the offer, but it seem to be a mismatch in example versions. I have been reworking the traits for converting to arrays and the example reflects the unreleased system. You can find a version that matches 0.6.0 if you select its label in the Code tab, or follow this link: https://github.com/Ogeon/palette/tree/0.6.0

alexfertel commented 3 years ago

Oh, I see. I'll try it out tonight. Thanks for the quick response.