MCPcopy Index your code
hub / github.com/annieversary/bevy_color_blindness

github.com/annieversary/bevy_color_blindness @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
19 symbols 22 edges 3 files 8 documented · 42% updated 3y ago★ 372 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Bevy Color Blindness Simulation

crates.io docs.rs

video showing 4 cubes of different colors as the different modes cycle

Bevy plugin to simulate and preview different types of Color Blindness.

This lets you ensure that your game is accessible to all players by testing how it will be seen under different conditions. While this is important, please also consider not relying on color alone to convey important information to your players. A common option is to add identifying symbols, like in the game Hue.

Based on Alan Zucconi's post. Supports: Normal, Protanopia, Protanomaly, Deuteranopia, Deuteranomaly, Tritanopia, Tritanomaly, Achromatopsia, and Achromatomaly.

Using

First, add the following to your Cargo.toml:

bevy_color_blindness = "0.2.0"

Then, add the ColorBlindnessPlugin to your app, and add ColorBlindnessCamera to your main camera.

use bevy::prelude::*;
use bevy_color_blindness::*;

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        // add the plugin
        .add_plugin(ColorBlindnessPlugin)
        .add_startup_system(setup)
        .run();
}

fn setup(mut commands: Commands) {
    // set up your scene...

    // create the camera
    commands
        .spawn_bundle(Camera3dBundle {
            transform: Transform::from_xyz(-2.0, 2.5, 5.0).looking_at(Vec3::ZERO, Vec3::Y),
            ..Default::default()
        })
        .insert(ColorBlindnessCamera {
            mode: ColorBlindnessMode::Deuteranopia,
            enabled: true,
        });
}

Important note

This plugin only simulates how color blind players will see your game. It does not correct for color blindness to make your game more accessible. This plugin should only be used during development, and removed on final builds.

Core symbols most depended-on inside this repo

run
called by 1
src/plugin.rs
percentages
called by 1
src/lib.rs
cycle
called by 1
src/lib.rs
build
called by 0
src/plugin.rs
finish
called by 0
src/plugin.rs
from_world
called by 0
src/plugin.rs
update
called by 0
src/plugin.rs
update_percentages
called by 0
src/plugin.rs

Shape

Method 8
Class 6
Function 4
Enum 1

Languages

Rust100%

Modules by API surface

src/plugin.rs10 symbols
src/lib.rs6 symbols
examples/main.rs3 symbols

For agents

$ claude mcp add bevy_color_blindness \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page