MCPcopy Index your code
hub / github.com/endbasic/endbasic / get_color

Method get_color

std/src/console/cmds.rs:151–158  ·  view source on GitHub ↗
(scope: &Scope<'_>, narg: u8)

Source from the content-addressed store, hash-verified

149
150 fn exec(&self, scope: Scope<'_>) -> CallResult<()> {
151 fn get_color(scope: &Scope<'_>, narg: u8) -> CallResult<Option<u8>> {
152 let i = scope.get_integer(narg);
153 if i >= 0 && i <= u8::MAX as i32 {
154 Ok(Some(i as u8))
155 } else {
156 Err(CallError::Syntax(scope.get_pos(narg), "Color out of range".to_owned()))
157 }
158 }
159
160 let (fg, bg) = if scope.nargs() == 0 {
161 (None, None)

Callers

nothing calls this directly

Calls 2

get_integerMethod · 0.80
get_posMethod · 0.80

Tested by

no test coverage detected