hecrj / coffee

An opinionated 2D game engine for Rust
https://docs.rs/coffee
MIT License
1.08k stars 55 forks source link

Color improvements #74

Closed PvdBerg1998 closed 5 years ago

PvdBerg1998 commented 5 years ago

Some ideas possibly worth implementing:

PvdBerg1998 commented 5 years ago
hecrj commented 5 years ago

Hex constructor: Color::hex(0xFFFFFF)

The lack of a u24 type makes this a bit awkward, but I think it's fine provided that we find a good name for it. ggez calls it from_rgb_u32.

Additional constants

Do you mean additional built-in colors? I think the idea is to encourage users to define their own color palettes, instead of providing a default one.

Other color spaces (constructors and conversion)

This would be great, but it feels a bit out of scope. There are already other color crates that can do the job, like palette.

PvdBerg1998 commented 5 years ago

Do you mean additional built-in colors? I think the idea is to encourage users to define their own color palettes, instead of providing a default one.

Is it okay to add some simple constants like red and green? I like to use them for quick prototyping when I just want some placeholder colors.