KristofferC / Crayons.jl

Colored and styled strings for terminals.
Other
150 stars 14 forks source link

Use UInt8 in ANSIColor rgb fields #40

Closed savq closed 4 years ago

savq commented 4 years ago

Hello there,

Currently the definition of the ANSIColor struct (in src/crayon.jl) has three fields of type Int, and an inner constructor that checks the bounds of the values passed to these fields.

I'd like to propose changing the type of these fields to UInt8. I think using a smaller integer type would:

An alternative would be to parametrize these fields, allowing ANSIColor structs of different sizes.

I'm still new to the Julia language, so if there's a good reason for defining the struct like that, It'd be good to know. I noticed this while setting up OhMyREPL, very cool project, thanks for working on this.