This language bar is your friend. Select your favorite languages!

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
#Edit dateEdit SummaryEditor
👁 Δ 29 2018-08-03, 21:00 [Rust] Fixed demo (zero-padding) programming-idioms.org
👁 Δ 28 2018-06-12, 18:50 New Rust implementation by user [GobbleCock] GobbleCock
👁 Δ 27 2018-04-14, 16:12 [Python] improved commentary bukzor
👁 Δ 26 2018-04-14, 05:28 New Python implementation by user [bukzor] bukzor
👁 Δ 25 2017-10-28, 12:06 New Python implementation by user [Oldboy] Oldboy
👁 Δ 24 2017-08-22, 12:13 [D] Homogeneous sample values in demo links programming-idioms.org
👁 Δ 23 2017-07-27, 23:41 New D implementation by user [Bzzzzzzz] Bzzzzzzz
👁 Δ 22 2016-11-27, 23:00 New JS implementation by user [programming-idioms.org] programming-idioms.org
👁 Δ 21 2016-11-13, 13:19 [Ruby] +DemoURL programming-idioms.org
👁 Δ 20 2016-11-13, 13:12 Updated picture URL by user [programming-idioms.org] programming-idioms.org
👁 Δ 19 2016-11-13, 13:09 Important note about gamma correction programming-idioms.org
👁 Δ 18 2016-11-12, 23:45 [Ruby] two unnecessary parens. steenslag
👁 Δ 17 2016-11-12, 23:25 [Ruby] shaved off a line steenslag
👁 Δ 16 2016-11-12, 23:01 [Ruby] looks somewhat nicer. steenslag
👁 Δ 15 2016-11-12, 22:55 [Ruby] Bugfix steenslag
👁 Δ 14 2016-11-12, 21:11 [Pascal] Incomplete impl programming-idioms.org
👁 Δ 13 2016-11-12, 21:07 [Ruby] Buggy impl programming-idioms.org
👁 Δ 12 2016-11-12, 17:49 New Ruby implementation by user [steenslag] steenslag
👁 Δ 11 2016-11-11, 16:18 +keywords programming-idioms.org
👁 Δ 10 2016-11-10, 17:11 New Pascal implementation by user [Bart] Bart
👁 Δ 9 2016-10-30, 21:55 [Go] Fixed imports programming-idioms.org
👁 Δ 8 2016-10-30, 21:54 New Go implementation by user [programming-idioms.org] programming-idioms.org
👁 Δ 7 2016-10-30, 21:46 New Java implementation by user [programming-idioms.org] programming-idioms.org
👁 Δ 6 2016-10-30, 21:44 [Java] Missing code at the end (too long) programming-idioms.org
👁 Δ 5 2016-10-30, 21:37 New Java implementation by user [programming-idioms.org] programming-idioms.org
👁 Δ 4 2016-10-30, 21:20 +keyword hexadecimal programming-idioms.org
👁 Δ 3 2016-10-30, 21:13 [Go] Better wording concision -> conciseness programming-idioms.org
👁 Δ 2 2016-10-30, 01:22 [Go] Comment emphasis programming-idioms.org
1 2016-10-30, 01:22 Idiom creation by user [programming-idioms.org] programming-idioms.org