kornelski / rust-rgb

struct RGB for sharing pixels between crates
https://lib.rs/rgb
MIT License
98 stars 19 forks source link

Rename `HetPixel::COMPONENTS` #133

Closed ripytide closed 2 months ago

ripytide commented 2 months ago

As it stands it gives the wrong impression that is is somehow relating to the values of the components themselves and not the number of components. My suggestions are to rename it to either COMPONENTS_LEN or COMPONENTS_COUNT with a mild preference for COMPONENTS_LEN due to it being shorter and "len" signifying more a const-sized lookup like Vec::len() as opposed to Iterator::count().

ripytide commented 2 months ago

Although COMPONENTS_COUNT is slightly clearer in that it is counting the number of components whereas COMPONENTS_LEN could be interpreted as being the bit-length of each individual component.

ripytide commented 2 months ago

Maybe even COMPONENTS_NUM

kornelski commented 2 months ago

NUM_COMPONENTS?

ripytide commented 2 months ago

Yep that works for me :+1: