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
Currently it is very hard to convert colors at compile time.
If you know the type already you can do this conversion manual .
But if you do not know the type yet you can not simple create a Bgr888 and call .into(), because it is not const.
A solution for this would be to add a const from_rgb(r, g,b) -> Self or const new_rgb(r, g,b) -> Self function to each color type (including the grays). So you can simple enter your "normal" 8bit color and it would be converted at compile time. The function could be implementation by using the already existing, but not public const functions.
This would very useful for usage inside macros. Current macros version can only create GrayColor, BinaryColor or PixelColor, but not for all at the same time, because they have a different new functions and need a special solution for each of them.
The text was updated successfully, but these errors were encountered:
Currently it is very hard to convert colors at compile time.
If you know the type already you can do this conversion manual .
But if you do not know the type yet you can not simple create a Bgr888 and call
.into()
, because it is not const.A solution for this would be to add a
const from_rgb(r, g,b) -> Self
orconst new_rgb(r, g,b) -> Self
function to each color type (including the grays). So you can simple enter your "normal" 8bit color and it would be converted at compile time. The function could be implementation by using the already existing, but not public const functions.This would very useful for usage inside macros. Current macros version can only create
GrayColor
,BinaryColor
orPixelColor
, but not for all at the same time, because they have a differentnew
functions and need a special solution for each of them.The text was updated successfully, but these errors were encountered: