Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent color definition #10

Closed
LeCalicot opened this issue Oct 7, 2023 · 5 comments
Closed

Inconsistent color definition #10

LeCalicot opened this issue Oct 7, 2023 · 5 comments
Assignees
Labels
enhancement New feature or request hacktoberfest Hacktoberfest Participations help wanted Extra attention is needed

Comments

@LeCalicot
Copy link

I was looking at the Simple example (it also applies to other examples as well) and in particular that part of the code:

SplashItem {
                            asset: SplashAssetType::SingleText(
                                Text::from_sections([
                                    TextSection::new(
                                        "Simple Test\n",
                                        TextStyle {
                                            font_size: 40.,
                                            color: Color::WHITE,
                                            ..default()
                                        },
                                    ),
                                    TextSection::new(
                                        "by\n",
                                        TextStyle {
                                            font_size: 24.,
                                            color: Color::WHITE.with_a(0.75),
                                            ..default()
                                        },
                                    ),
                                    TextSection::new(
                                        "Sergio Ribera",
                                        TextStyle {
                                            font_size: 32.,
                                            color: Color::WHITE,
                                            ..default()
                                        },
                                    ),
                                ])
                                .with_alignment(TextAlignment::Center),
                                "FiraSans-Bold.ttf".to_string(),
                            ),
                            tint: Color::SEA_GREEN,
                            width: Val::Percent(30.),
                            height: Val::Px(150.),
                            ease_function: EaseFunction::QuarticInOut.into(),
                            duration: Duration::from_secs_f32(5.),
                            is_static: false,
                        }

When I compile it, the text is SEA_GREEN, not white. It seems there is no way to set the color separately for each of the TextSection, everything is overwritten by the tint field value.

@SergioRibera
Copy link
Owner

This part is a bit more complicated, because of the animation issue with the tween, let me investigate to see what I can achieve, for now I'm looking at the #8 issue

@SergioRibera SergioRibera added bug Something isn't working help wanted Extra attention is needed hacktoberfest Hacktoberfest Participations labels Oct 7, 2023
@LeCalicot
Copy link
Author

No problem. For my current project, there is nothing blocking and I can live with the current code :)
But I guess that could be nice to have those improvements in the future.

@SergioRibera
Copy link
Owner

SergioRibera commented Oct 7, 2023

Wait, I've just given the code some thought and it looks like it's not that complicated to do, I'll put together a PR right now. First I would like to know how you suggest to handle the colors for the sections, because they need to have a fade, I imagine that to transparent by default, right?

[Text Color] ---> [Transparent] ---> [Text Color]

@SergioRibera
Copy link
Owner

No problem. For my current project, there is nothing blocking and I can live with the current code :) But I guess that could be nice to have those improvements in the future.

Your suggestions are very good, I really appreciate it, initially I had thought about it in another way and to see other points of view is very good 😄

@SergioRibera SergioRibera added enhancement New feature or request and removed bug Something isn't working labels Oct 7, 2023
@SergioRibera SergioRibera self-assigned this Oct 7, 2023
@SergioRibera SergioRibera mentioned this issue Oct 7, 2023
@SergioRibera
Copy link
Owner

Solved in #15 , I hope later to change the tint for another way of coloring the images

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest Hacktoberfest Participations help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants