You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
The draw_text function currently use this formula to modify the color : let mult = (1.0 - v).min(1.0); color::RGB((c1 * mult) as u8, (c2 * mult) as u8, (c3 * mult) as u8)
But when using it, it modify only the background of the glyph (which stay in black) :
Since it is more interesting to modify the color of the glyph itself, maybe this formula could be better (that's what I'm using) : color::RGB((255.0+(c1-255.0)*v ) as u8, (255.0+(c2-255.0)*v ) as u8, (255.0+(c3-255.0)*v ) as u8)
If we want it to work we also have to modify this (not useful anymore to do '255 - components[_]' I guess):
let c1 = f32::from(components[0]);
let c2 = f32::from(components[1]);
let c3 = f32::from(components[2]);
Then it is really the font that is changing color :
What do you think?
The text was updated successfully, but these errors were encountered:
I would love having independent color_foreground and color_background arguments. That would allow for more faded text like the screenshot above as well as text on darker panels.
Hello,
The draw_text function currently use this formula to modify the color :
let mult = (1.0 - v).min(1.0); color::RGB((c1 * mult) as u8, (c2 * mult) as u8, (c3 * mult) as u8)
But when using it, it modify only the background of the glyph (which stay in black) :
![](https://private-user-images.githubusercontent.com/58807436/321162842-feb347f3-c82e-48ed-b6b5-2bf45c63fd15.jpeg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0MDk4MjQsIm5iZiI6MTczOTQwOTUyNCwicGF0aCI6Ii81ODgwNzQzNi8zMjExNjI4NDItZmViMzQ3ZjMtYzgyZS00OGVkLWI2YjUtMmJmNDVjNjNmZDE1LmpwZWc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjEzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxM1QwMTE4NDRaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0yOTRiZjBjNmJlOWI3MTEwNWFjNTAxMDY1ZTdjNDdhM2YxMDYzYzc4MzlhMDc4NGRjZDIzODIwODhlNjliYWE1JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.EppRzfYlqTkYQ7YtiQCpOm_JKI0AS8K9E7l-eJ3HBRc)
Since it is more interesting to modify the color of the glyph itself, maybe this formula could be better (that's what I'm using) :
color::RGB((255.0+(c1-255.0)*v ) as u8, (255.0+(c2-255.0)*v ) as u8, (255.0+(c3-255.0)*v ) as u8)
If we want it to work we also have to modify this (not useful anymore to do '255 - components[_]' I guess):
Then it is really the font that is changing color :
![](https://private-user-images.githubusercontent.com/58807436/321162994-73469246-1caa-4b42-9399-af05f904273f.jpeg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0MDk4MjQsIm5iZiI6MTczOTQwOTUyNCwicGF0aCI6Ii81ODgwNzQzNi8zMjExNjI5OTQtNzM0NjkyNDYtMWNhYS00YjQyLTkzOTktYWYwNWY5MDQyNzNmLmpwZWc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjEzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxM1QwMTE4NDRaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1hZDA2NTE1NjdjYmI5Y2YzZDUwNGJiZWEyMTI4NGVmZWFmMGEwZGU2M2I5NjNlZmQxYjNjMGM3YmYwNmMwMzQ0JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.oIOc_A5W_NIUVe08sBAe5vtJH8sOim7k5rXq5ow0wj4)
What do you think?
The text was updated successfully, but these errors were encountered: