Skip to content

Why does Color::rgb use f32 instead of u8? #364

@wyhaya

Description

@wyhaya

u8:

Color::rgb(0, 0, 0);
Color::rgb(255, 255, 255);
Color::rgb(3, 169, 244);

In many cases, rgb uses numbers from 0-255, and using u8 will not appear invalid colors

f32:

Color::rgb(312312321.312, 312312.0, 654645.1231);

f32 cannot verify the correctness of the value

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-RenderingDrawing game state to the screen

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions