FineFindus / eyedropper

Pick and format colors
https://apps.gnome.org/Eyedropper
GNU General Public License v3.0
267 stars 28 forks source link

Add glvec color format #59

Closed yuraiz closed 1 year ago

yuraiz commented 1 year ago

rgb / rgba format with float values between 0.0-1.0

can be used for shaders as vec3 / vec4 also can be configured as gdk::RGBA::new({r}, {g}, {b}, {a})

image

yuraiz commented 1 year ago

I don't think that it would be useful to have a separate parameter for rgb representation With separate formats I can use values for both css and glsl

Also internal representation is still 8-bit per channel so other notations than Arithmetic, Percentage and Digital 8-bit per channel are meaningless

yuraiz commented 1 year ago

BTW isn't it's more precise to use f64 as representation, as I see ashpd color request returns color with f64 representation

FineFindus commented 1 year ago

With separate formats I can use values for both css and glsl

That's a valid point, maybe this could be solved be opening multiple windows (currently not possible)? The issue I'm seeing is that, a less technical / somewhat technical user, who just hasn't worked with shaders yet, might be confused what vec3 is, as it does not appear in with other common color formats. And since it is only renamed RGB, it would make sense, to only have one RGB format, instead of multiple, which just differ in how the values are depicted.

Also internal representation is still 8-bit per channel so other notations than Arithmetic, Percentage and Digital 8-bit per channel are meaningless

Should be a pretty easy change, to switch from 8-bit to 32-bit. In any case, I think just switching between those three notations would still be valuable.

BTW isn't it's more precise to use f64 as representation, as I see ashpd color request returns color with f64 representation

That's correct, but gtk::gdk::RGBA uses f32, which was used before I implemented color picking and just forgot to update it everywhere else.

yuraiz commented 1 year ago

Maybe it's possible to have different names for different rgb representaions, like rgb1 and rgb256. but I don't want to switch parameter either time when I want different representation

I think users won't be confused with glvec more than with XYZ or HWB

FineFindus commented 1 year ago

XYZ and HWB are both well known color models, whereas vec3 technically isn't even one, as it just uses RGB values.

yuraiz commented 1 year ago

I don't want to open preferences every time when I want to change rgb representation, I can add that parameter also to menu.

image image