Logo

Programming-Idioms

History of Idiom 154 > diff from v28 to v29

Edit summary for version 29 by programming-idioms.org:
[Rust] Fixed demo (zero-padding)

Version 28

2018-06-12, 18:50:13

Version 29

2018-08-03, 21:00:46

Idiom #154 Halfway between two hex color codes

Find color c, the average between colors c1, c2.

c, c1, c2 are strings of hex color codes: 7 chars, beginning with a number sign # .
Assume linear computations, ignore gamma corrections.

Illustration

Idiom #154 Halfway between two hex color codes

Find color c, the average between colors c1, c2.

c, c1, c2 are strings of hex color codes: 7 chars, beginning with a number sign # .
Assume linear computations, ignore gamma corrections.

Illustration
Extra Keywords
hexa hexadecimal css avg mean radix base
Extra Keywords
hexa hexadecimal css avg mean radix base
Imports
use std::str::FromStr;
use std::fmt;
Imports
use std::str::FromStr;
use std::fmt;
Code
"Too long for text box, see online demo"
Code
"Too long for text box, see online demo"
Demo URL
https://play.rust-lang.org/?gist=7147648b12c22eb49f0c9f29cd2bb7c4&version=stable&mode=debug
Demo URL
https://play.rust-lang.org/?gist=319f6e391ba01079867bfe0080b600d5&version=stable&mode=debug&edition=2015