• 3 Posts
  • 20 Comments
Joined 1 year ago
cake
Cake day: August 5th, 2023

help-circle
















  • ICC profiles are definitely part of the field, but that’s sort of a topic of its own. At least in terms of scope. The color space rabbit hole is so deep that I never got as far as including them. There are other crates that go into those parts and it should be easy to bridge between them and Palette.

    I would say Palette is more for the “business logic” of working with colors, so converting, manipulating and analyzing. The difference from ICC profiles when converting with Palette is that you need to know more about the source and destination color spaces during compile time. ICC profiles use more runtime information.

    Palette could be used for applications like image manipulation programs, 3D rendering, generative art, UI color theme generation, computer vision, and a lot more. A lot of people also use it for smaller tasks like converting HSL input to RGB output or making gradients.



  • Förutom att välja de som verkar mest intressanta (finska vinterkriget är en bra klassiker) skulle jag också säga att man kan börja med de senaste och gå bakåt. De har en del repriser med bättre ljudkvalitet som man lätt missar annars. Enstaka serier är de enda man kan behöva se till att man börjar i rätt ände av, men de är tydligt numrerade eller ihopklippta.


  • It may be possible to use the Any trait to “launder” the value by first casting it to &Any and then downcasting it to the generic type.

    let any_value = match tmp_value {
        serde_json::Value::Number(x) => x as &Any,
        // ...
    };
    
    let maybe_value = any_value.downcast_ref::< T >();
    

    I haven’t tested it, so I may have missed something.

    Edit: to be clear, this will not actually let you return multiple types, but let the caller decide which type to expect. I assumed this was your goal.