Logo

Programming-Idioms

History of Idiom 154 > diff from v27 to v28

Edit summary for version 28 by GobbleCock:
New Rust implementation by user [GobbleCock]

Version 27

2018-04-14, 16:12:35

Version 28

2018-06-12, 18:50:13

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;
Code
"Too long for text box, see online demo"
Demo URL
https://play.rust-lang.org/?gist=7147648b12c22eb49f0c9f29cd2bb7c4&version=stable&mode=debug