text:
Draw the national flag of France
There have been many other flag challenges posted but not one for the national flag of France. This week seems like an appropriate time.
Produce this flag in the fewest bytes possible:

The image must be in a ratio of 3:2, with size at least 78 pixels wide and 52 pixels tall.
Each stripe takes up one third of the width.
The stripe colors from left to right are RGB: (0, 85, 164), (255, 255, 255), (239, 65, 53).
The image can be saved to a file or piped raw to STDOUT in any common image file format, or it can be displayed.
Alternatively, output a block of text at least 78 characters wide made of non-whitespace characters that depicts the flag, using ANSI color codes to color it. (Use standard blue, white, and red.)
Built-in flag images/libraries are not allowed.

The shortest code in bytes wins.
Leaderboard
The Stack Snippet at the bottom of this post generates the leaderboard from the answers a) as a list of shortest solution per language and b) as an overall leaderboard.
To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:
## Language Name, N bytes

where N is the size of your submission. If you improve your score, you can keep old scores in the headline, by striking them through. For instance:
## Ruby, <s>104</s> <s>101</s> 96 bytes

If there you want to include multiple numbers in your header (e.g. because your score is the sum of two files or you want to list interpreter flag penalties separately), make sure that the actual score is the last number in the header:
## Perl, 43 + 2 (-p flag) = 45 bytes

You can also make the language name a link which will then show up in the snippet:
## [><>](http://esolangs.org/wiki/Fish), 121 bytes

 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Shortest Solution by Language

Language	User	Score

Leaderboard

	Author	Language	Size

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

Those RGB values don't match your image. From what I see, you've got RGB: (0, 35, 149), (255, 255, 255), (237, 41, 57).

Storing the specified palette compactly is probably the trickiest part of this problem in most languages. Given that, it seems rather unfair to graphical solutions to permit ANSI output with a standard palette. Why not permit graphical solutions to use pure (0, 0, 255)/(255, 255, 255)/(255, 0 0) to level the playing field?

Each stripe takes up one third of the width.  Might be more interesting to use the Naval variant:  by a regulation dated 17 May 1853, the navy went back to using the 30:33:37 proportions, which it now continues to use, as the flapping of the flag makes portions farther from the halyard seem smaller.

echo  not quite big enough

How many lines are required with the ANSI text option?

Since most browser consoles don't support ansi escape codes for coloring but do allow styling with %c and matching css declarations is that permitted? As in: http://codegolf.stackexchange.com/a/64159/11182

Is a Windows batch file accepted? I mean to say a .cmd or .bat file. I'm new to this site, I don't know if that counts as a language.

@ghosts_in_the_code Yes, Windows batch is an acceptable language here. There are plenty of answers in it around the site.

@JohnE I agree. The rules on colors give the ASCII-art solutions a massive advantage. They also don't make the challenge any more "difficult" (merely adds bytes really) for the languages that can use arbitrary colors and disqualifies several cool languages that can't do arbitrary colors.

Is the use of these emojis allowed ⚪, as per this answer?

@BenJackson with your suggestions my css example would perform better than the regular version of the flag :)

@Steve, for java, do import statements count against the byte total? My imports alone are 62 bytes lol.

Finally, I found this page again.

CJam, 23 22 bytes
00000000: 27 9b 22 5c 22 25 1f 22 66 7b 69 27 6d 32 37 2a  '."\"%."f{i'm27*
00000010: 7d 4e 5d 32 36 2a                                }N]26*

The above is a hexdump that can be reversed with xxd -r.
At the cost of two extra bytes – for a total of 24 bytes – we can use background colors instead, making the output a bit prettier.
00000000: 27 9b 22 2c 2f 29 00 22 66 7b 69 27 6d 53 32 36  '.",/)."f{i'mS26
00000010: 2a 7d 57 4e 74 32 36 2a                          *}WNt26*

How it works
In both programs, we use the ANSI escape sequence \x9bXYm – where X is 3 for foreground color and 4 for background color, and Y specifies the color to use – to switch between the three colors of the flag.
'<CSI>       Push the '\x9b' character (Control Sequence Introducer).
"\"%<US>"    Push the string of the ISO 8859-1 characters with code
             points 34, 37, and 31.
f{           For each character in the string, push the CSI and that
             character; then:
  i            Cast the character to integer.
  'm27*        Push 27 m's. The first completes the control sequence,
               the remaining 26 will be printed.
}
N]           Wrap the generated array and "\n" in an array.
26*          Repeat it 26 times.

The other program is similar.
Output

I'm currently unsure how tall I should make the "image".

I went with 78x30 in my answer. Those dimensions in Lucida Console 9 pt (the default font for xterm) gave the closest to 3:2.

You could use a full block for 'prettyness'

Pure Bash (on OSX), 84
The default OSX terminal supports full colour emojis.  Not sure if this counts as text or graphical output.
printf -vs %26s
for i in {1..26}
do echo ${s// /}${s// /⚪}${s// /}
done

Output looks like:

Alternatively:
Bash with OSX utilities, 56
yes `dc -e3do26^d1-dn2/*p|tr 201 ⚪`|sed 26q

The dc expression:

calculates 3^26-1 and prints it in ternary 22222222222222222222222222
divides this by 2, then multiplies by 3^26.  Output in ternary this is 1111111111111111111111111100000000000000000000000000

tr then translates the 210 characters to ⚪.
yes outputs this line indefinitely.
sed 26q halts output at 26 lines.

A terminal that supports emojis. Wow.

The first solution doesn't use the right RGB values nor does it use the standard ANSI colors, does it?

@Doorknob You're right of course - neither solutions do - so this answer may be overstepping the line.  I've asked the OP for clarification

It's just Unicode.

For me it doesn't even look like the france flag. It looks more kinda grey.

A slightly more compact version: printf -vs %26s;yes ${s// /}${s// /⚪}${s// /}|head -26

@Daniel 67 bytes > 56 bytes.  Or am I measuring it wrong?

@steve I wasn't really expecting this answer to become so popular, especially given that there are questions regarding its validity.  Can you give a yay or nay as to whether you think it is valid?  Thanks!

How do you do byte counting? When I paste your answers at http://www.lettercount.com, I get much smaller byte counts (even though it counts emojis as 2 characters, which I think is correct.)

@DigitalTrauma I was looking at the 84 byte one. The second one is better than mine, yes..

@geokavel I usually just start wc, paste in the script and hit ^D.  But you can also use this online counter.  lettercount.com is counting characters and not bytes.  The  and  are 4 bytes each and the ⚪ is 6 bytes.

Hm, I've seen unicode characters counted as 1 byte before. It seems unfair to make them count as so many bytes.

@geokavel Its not unfair.  UTF-8 encodes the 128 ASCII characters as one byte each, but others (non-ASCII) are encoded in anything from 2 to 6 bytes.

Would UTF-16 help?

@ev3commander No, I don't think so - each character in the whole script would end up taking up 2 bytes, which would certainly significantly increase the score.  UTF-8 is best for this because it encodes almost all of what we need in just one byte per char, with just the funny dots taking up more.

Oh. I thought that since Funciton programs (using lots and lots of Unicode) are encoded with UTF-16 to get lower byte  counts, this would too.

@ev3commander For the record I just tried it - iconv -t UTF-16 fr.sh | wc -c gives 98 bytes.  I'm not familiar with funciton, but with a brief look over its esolangs page I would guess it would encode better in CP437 which gives most of those characters in a single byte

Desmos, 30 12 bytes
3x>10
3x<-10

Try it online.
I'm not entirely sure if this is valid, please let me know if there are any issues.

Don't forget to mentiond setting the colours.

@CᴏɴᴏʀO'Bʀɪᴇɴ Default colors are red and blue in that order (I believe) so there is no need to set them.

You could just do x<-1\nx>1 and tell the people to zoom in :P And they are not the default colours; they are randomly chosen afaik

@CᴏɴᴏʀO'Bʀɪᴇɴ Then it's a random flag generator ;)

@CᴏɴᴏʀO'Bʀɪᴇɴ They're not random for me - inputting two inequalities manually is consistently getting me red, then blue.

@Mego I got blue then green :P

This is strange. I'm getting red and blue as well.

@CᴏɴᴏʀO'Bʀɪᴇɴ I didnt get that x<-1\nx>1. Could you please explain it? What is n here?

@Kartik \n is a newline.

are those the right blue and red?

I don't think it is... nor does it fit the aspect ratio precisely.

The aspect ratio is fine (at least for me) but the colors are not right.

The colours were right for me as well as the ratio

@muddyfish the colors need to be exactly (0, 85, 164), (255, 255, 255), (239, 65, 53).

Here's a color-accurate way: https://www.desmos.com/calculator/vjdeyyxyeb, but it sadly requires additional Desmos stuff. There's no way to use the default colors (even with good ordering) to get a correct result.

Python 2, 47 bytes
s="[3%smF";print(s%4*26+s%7*26+s%1*26+"\n")*30

Contains unprintables - here's a hexdump (reversible with xxd -r):
00000000: 733d 221b 5b33 2573 3b31 6d46 223b 7072  s=".[3%s;1mF";pr
00000010: 696e 7428 7325 342a 3236 2b73 2537 2a32  int(s%4*26+s%7*2
00000020: 362b 7325 312a 3236 2b22 5c6e 2229 2a33  6+s%1*26+"\n")*3
00000030: 30                                       0

Uses ANSI escape codes to print colored characters to STDOUT - I chose "F" for France. No online link because ideone doesn't support ANSI escape codes in output.
Thanks to Dennis and xnor for some great tips.
Screenshot from xterm:

You've got an extra space there. in [0] --> in[0]

You can use actual ESC bytes instead of \x1b. 2. Bolding doesn't seem to be necessary. 3. I'm not sure if that applies to ANSI art as well, but the question seems to mandate a 3 : 2 ratio.

It's shorter to sub in the parameters with formatting: print("\x1b[3%s;1mF"*78+"\n")%((4,)*26+(7,)*26+(1,)*26)*30.

Or better: s="\x1b[3%s;1mF";print(s%4*26+s%7*26+s%1*26+"\n")*30.

Press F to pay respects

Are you sure that the first 's' should be in the code block? I can't see it, and it doesn't seem to work with it (but I haven't tested it it, I'm on my phone)

@Loovjo Thanks for pointing that out, it was the result of a failure to copy and paste correctly :)

The █ character looks slightly nicer, e.g.  print("\x1b[3%s;1m█"*78+"\n")%((4,)*26+(7,)*26+(1,)*26)*30

HTML / SVG, 76 bytes 87 88 121 122 149
Saved 27 bytes thanks to @insertusernamehere
Saves 9 bytes thanks to @Joey
Saved 1 bytes thanks to @sanchies
Saves 1 bytes thanks to @Neil
<svg><path fill=#0055a4 d=m0,0h26v52H0 /><path fill=#ef4135 d=M52,0h26v52H52

Using lots of HTML syntax abuse, this can get pretty short.

Screenshot of output:

Or try it (make sure your browser supports SVG):

<svg><path fill=#0055a4 d=m0,0h26v52H0 /><path fill=#ef4135 d=M52,0h26v52H52

I tried to beat you with CSS and now I have golfed your SVG that it is even smaller than my CSS solution. :D This is the shortest I could get to work in Safari, Chrome and Firefox, it's 122 bytes long: <svg><rect width=78 height=52 fill="#ef4135"/><rect width=52 height=52 fill="#fff"/><rect width=26 height=52 fill=#0055a4>

@insertusernamehere Thanks, That saved 27 bytes! I've managed to further golf this down to an astonishing 88 bytes

I think the second to last rule only applies to text output, because console output can only be basic colors.

@geokavel oh gotcha, I'll rollback

It may just be me but your flag is upside down :S

@Spaceman whoops, fixed

For me, fill=#0055a4 /> works too (no "), saving a whole byte.

PHP to produce this svg (69 bytes): <svg<?=$x='><rect width=26 height=52 fill='?>"#0055a4"/<?=$x?>#ef4135 (may be golfed even further)

It was upside down, now it's upside down and backwards!

@sanchises a whole byte? o_O wow :D

@developerbmw Actually, it would be more impressive to save half a byte when you think about it.

@sanchises true, true. We need a programming language that only uses characters with values 0xF and below and the source can be compressed to use half-bytes :)

This fails when the context it's shown in has a non-white background. I don't think the SVG spec mandates renderers to assume a white background.

@Anko HTML defaults to a white background. This isn't really an SVG file, more of just SVG in HTML, otherwise the syntax would be invalid. A language is defined by it's implementation so I'd say it's fine

If we stick with not showing the white part, then I got it down to 79, rendering correctly in IE, Chrome, and FF: <svg><path fill=#0055a4 d=m0,0h26v52H0 /><path fill=#ef4135 d=M52,0h26v52H52/>. No one in their right mind should use rect when golfing SVG.

For me with Firefox I was able to remove the second / character for another byte saved.

Brainfuck$, 153 bytes
+++++++++++++[->>>++>+++++++>++++>>>>++++++++>+++<<<<<<<<<<]>>>+>>#->$#>$#+++++++>$--->+++++[<]<<+++++[->+++++>++++++<<]>+#>($#([-]>[.>]<[<])>>>>+++<<<<)

Outputs the image with ANSI color codes. I chose a height of 30 like Mego.
The reference implementation from 2009 linked on the esolangs page has gone missing. You can run it using this interpreter made by me, which supports everything from the esolangs page.

window.addEventListener("load",function(){document.querySelector("#r").addEventListener("click",function(){var  c=document.querySelector("#c").value,u=document.querySelector("#i").value,d=Array(30000).fill(0),p=0,i=0,q=0,s=[],o=document.querySelector("#o");o.value="";eval(c.replace(/[^]/g,function(e,i){return{"+":"d[p]=(-~d[p]+256)%256;","-":"d[p]=(~-d[p]+256)%256;",">":"p++;","<":"p--;",",":"d[p]=q-u.length?u[q++].charCodeAt()%256:0;",".":"o.value+=String.fromCharCode(d[p]);","[":"while(d[p]){","]":"}","#":"s.push(d[p]);","$":"d[p]=s.pop();",";":"d[p]=(parseInt(prompt())%256+256)%256;",":":"o.value+=d[p].toString();","(":"for(var i"+i+"=d[p];i"+i+">0;i"+i+"--){",")":"}","@":"o.value+=('D '+d.slice(0,20)+'\\nS '+s+'\\nIP '+i+' DP '+p);"}[e]||"";}));});});
Code:
<textarea style="width:100%;height:15em;white-space:pre" id=c>+++++++++++++[->>>++>+++++++>++++>>>>++++++++>+++<<<<<<<<<<]>>>+>>#->$#>$#+++++++>$--->+++++[<]<< init sequence to cells 3 to 10
+++++[->+++++>++++++<<] set cells 1~2 to 25 & 30
>+ set cell 1 to 26
# push 26 to stack
> go to cell 2
( do 30 times
    $# get 26 to this cell from stack
    ( do 26 times
        [-]>[.>]<[<] print sequence
    )
    >>>>+++<<<< change color to white
    $# get 26 to this cell from stack
    ( do 26 times
        [-]>[.>]<[<] print sequence
    )
    >>>>------<<<< change color to red
    $# get 26 to this cell from stack
    ( do 26 times
        [-]>[.>]<[<] print sequence
    )
    >>>>+++<<<< change color to blue
    ++++++++++. print newline
)</textarea>
<button id=r>Run</button>
Input:
<textarea id=i style="width:100%"></textarea>
Output:
<textarea readonly id=o style="width:100%;height:15em;white-space:pre"></textarea>

Brainfuck, 258 bytes
This is basically the same thing, but just in plain old Brainfuck.
>>+++++++++++++[-<<++>>>>++>+++++++>++++>++++>+++++>++++>++++++++>+++[<]<]>>+>>->>------>--->+++++[<]<<<++++[>+++++[->+++++<]>+[>>[.>]<[<]<-]>>>>>+++[<]+++++[-<+++++>]<+[>>[.>]<[<]<-]>>>>>------[<]+++++[-<+++++>]<+[>>[.>]<[<]<-]>>>>>+++[<]<++++++++++.[-]<<-]

Or, if you prefer this one in oOo CODE (984 bytes):
one day ThERe WIlL Be PEaCE iN ThIS wORlD
OnE DaY ThERe WiLl Be peaCe iN ThIS wOrld
one day theRe WIlL be pEaCE iN ThIS wORlD
OnE DaY theRe WIlL Be PEaCe in ThIS wORlD
OnE day ThERe WIlL Be PEaCe in ThIS wORlD
OnE day ThERe WIlL Be PEaCE iN ThIS wOrld
OnE DaY ThErE wilL bE PeaCe IN this woRlD
one day There will Be pEacE in ThiS woRld
one Day TheRe will Be PEaCE iN ThIS wOrLd
onE dAY thEre WilL Be PEaCE iN ThIs World
OnE DaY ThERe WIlL bE pEace in ThIS wORlD
OnE DaY thErE Will Be PeAce in this WoRLd
one dAY thErE wilL bE PeaCE in tHIs world
one day theRe WIlL Be PeAce iN tHIS wORlD
OnE DaY ThErE wIll be PEaCE iN ThIS wORlD
one dAY thERe WiLl be peace In THis worLD
onE dAy thErE WilL Be peACe in this world
one Day TheRe wIll Be pEace In thIs WORlD
OnE DaY ThERe WiLl Be peaCE iN ThIS wORlD
OnE day tHEre WIlL bE peace in tHiS World
oNE daY tHere WiLL be PEace IN this world
one day ThERe WIlL bE peaCe IN thIS wORlD
OnE DaY ThERe WIlL Be PEaCE iN THis WoRld
oNE daY thERe wiLL

LaTeX, 139 bytes
Thanks to @WChargin for saving 21 bytes.
\documentclass{proc}\input color\begin{document}\def\z#1!{{\color[rgb]{#1}\rule{4cm}{8cm}}}\z0,.33,.64!\z1,1,1!\z.94,.25,.21!\end{document}

This prints the following 12cm*8cm image on an A4 page:

Note that "Page 1" is also printed at the bottom of the page

Well this is about 100 bytes shorter than my asymptote solution...

s.\newcommand\z[1].\def\z#1 to save a bunch of bytes. Also, you can shave off a few by using \def\z#1!{…}\z0,.33,.64!\z1,1,1!\z.94,.25,.21!—that is, use your own delimiters instead of braces for grouping

You can also \input color

For completeness, revised version (139 bytes): \documentclass{proc}\input color\begin{document}\def\z#1!{{\color[rgb]{#1}\rule{4cm}{8cm}}}\z0,.33,.64!\z1,1,1!\z.94,.25,.21!\end{document}

You can save 4 bytes by using the active character ~ in place of \z.

If you bypass LaTeX’s output routine and just ship a box containing the flag, you don’t need any of the usual nonsense like \documentclass and \begin/\end{document}. (This also neatly gets rid of the unwanted “Page 1”.) On an unrelated note, the outer brackets inside the definition of the macro are unnecessary. So all in all, here is a 116 byte version: \input color\catcode`@11\def~#1!{\color[rgb]{#1}\rule{4cm}{8cm}}\shipout\hbox{~0,.33,.64!~1,1,1!~.94,.25,.21!}\@@end. (Here, \@@end is LaTeX’s renaming of the primitive TeX command \end. The \catcode change is to make it work.)

Oh, and a 108 byte version using dirty tricks: \input color\def~#1!{\color[rgb]{#1}\rule{4cm}{8cm}}\shipout\hbox{~0,.33,.64!~1,1,1!~.94,.25,.21!}\batchmode. Here, the \end command is omitted entirely; this leads to an error, but the \batchmode silences it and allows the job to finish. In fact, if you are running LaTeX in an IDE rather than from a terminal, chances are it may have already set \batchmode from the command line, in which case it may be omitted, too.

Bash + ImageMagick, 60 77 73 bytes
convert -sample 78x52\! - a<<<"P3 3 1 255 0 85 164 255 255 255 239 65 53"

(ugh, +17 chars due to color requirements I didn't notice earlier...)
Outputs to the file a, in netpbm format:
llama@llama:~$ convert -sample 78x52\! - a<<<"P3 3 1 255 0 85 164 255 255 255 239 65 53"
llama@llama:~$ file a
a: Netpbm image data, size = 78 x 52, rawbits, pixmap

Can also output in PNG, if you change the filename to a.png (+4 chars).
Output:

convert -sample 78x52\! - a<<<"P3 3 1 255 0 85 164 255 255 255 239 65 53"

@DigitalTrauma Thanks! That saves 4 chars and doesn't exit with an error. (Also, I never knew ImageMagick could read from / write to STDIN.)

You can use -scale instead of -sample; also, the backslash doesn't seem to be necessary

Pyth, 27 bytes
 .w*52[smmdGc3CM"\0U¤ÿÿÿïA5

There are some unprintable chars, so here's a hexdump:
00000000   2E 77 2A 35  32 5B 73 6D  6D 64 47 63  33 43 4D 22  .w*52[smmdGc3CM"
00000010   5C 30 55 A4  FF FF FF EF  41 35                     \0U.....A5

This creates a file o.png, which is exactly 78 pixels wide and 52 pixels tall:

Explanation:
.w*52[smmdGc3CM"........
               "........  a string containing the bytes
                          0, 85, 164, 255, 255, 255, 239, 65, 53
             CM           convert them to integers
           c3             split into 3 lists
      smmdG               duplicate each list 26 times
     [                    put them into a list
  *52                     and duplicate it 52 times
.w                        save it as an image o.png

For a second, I thought I had grossly misunderstood the PNG specification.

save it as an image o.png, but there's no ".png" anywhere?

@AsidShout How do you call the program? If you use python3 pyth.py code.pyth, then you can find it in the same directory.

HTML (quirks mode), 68 bytes
This uses quirks mode to render the flag.
The HTML is VERY invalid, but works on a stock Android 4.4.2 browser and on Firefox 42.0 (on Windows 7 x64).

The flag is rendered with the right size and the standard red and blue colors. All webpages start with a standard white background.

As an alternative:
A perfectly valid HTML5 version (141 bytes):

<!DOCTYPE html><title>x</title>

Check it's validity on: https://html5.validator.nu/
Print-screen of the result:

Are you sure? When I have a HTML file with only this line, it doesn't work in Firefox, Chrome and Safari. If the file contains other HTML-elements after that line, it works for me. So maybe you can't discard the trailing >?

"Perfectly valid"? It should be style="..." if that's what you're going for in the second example.

@mbomb007 What I am going for is to create the smallest valid HTML code. It validates with the official validator, so, it is perfectly valid HTML. You can try it yourself if you don't believe.

@mbomb007 Also, missing quotes is the smallest issue: there's no , no , no , no
, no 	 and no closing of all missing tags.

@insertusernamehere You were right. It was bugging on Android too. I tested it on jsfiddle. But when accessing data:text/html,
, it wasn't working. Fixed it now, and use the link to test it.

ffmpeg, 110 113 116 117 119 108 100 bytes
Display, using ffplay, 100 bytes:
ffplay -f lavfi color=#0055a4:49x98[r];color=white:49x98[w];color=#ef4135:49x98[b];[r][w][b]hstack=3

Saved to file, using ffmpeg, 108 bytes:
ffmpeg -lavfi color=#0055a4:49x98[r];color=white:49x98[w];color=#ef4135:49x98[b];[r][w][b]hstack=3 -t 1 .png

The current version of the command will abort with an error BUT will output a single image ".png", same as shown below.

Wow. Abusing ffmpeg to make images...

Heh, I saw this question and thought of doing the same. Nice job making it compact. If it is allowed you can make it slightly smaller by using white instead of #ffffff: the values should be the same.

I know. Wasn't bothered enough. Will do it now.

Does #fff work?

No. But I can skip the f in f.png

Where exactly is the output? I don't see a flag anywhere, but I do get -bash: [r][w][b]hstack=3: command not found.

A file .png is created i.e. Name is blank and extension is PNG. Works here on Win7.

CSS, 127 128 144 bytes
body:before,body:after{content:'';float:left;width:33%;height:100%;background:#0055a4}body:after{float:right;background:#ef4135}

No need for another tag, works solely with the body-element.
Edits

Saved 16 bytes by removing display:block; and some ;.
Saved 1 byte, removed the trailing }.

Though technically CSS isn't a programming language by our definitions.

@CᴏɴᴏʀO'Bʀɪᴇɴ I know – just wanted to beat SVG.

@CᴏɴᴏʀO'Bʀɪᴇɴ is right, this is not a valid answer.

This is no longer beating the SVG answer.

@Riking I know, after I posted this answer I outplayed myself by golfing the SVG answer to a lower byte count. :)

@CᴏɴᴏʀO'Bʀɪᴇɴ What exactly are the definitions?

@Random832 These, mon amis, are the definitions.

@CᴏɴᴏʀO'Bʀɪᴇɴ Well, if that includes HTML+CSS, this is just the combination of the given CSS file with the empty HTML document.

@Random832 HTML isn't a programming language alone by our standards.

@CᴏɴᴏʀO'Bʀɪᴇɴ Then you're going to have to make it a bit more clear what you meant by this link, because it links to a question, and the highest voted answer is Peter Taylor's, and he says in a comment on another answer that HTML+CSS qualifies.

@Random832 Don't be ticked. If you think it's okay, then roll with it. Only my opinion.

@CᴏɴᴏʀO'Bʀɪᴇɴ it the css was saved as a SASS file, since SASS is a scripting language would it be a valid answer?

@FabrizioCalderan So long as the program is valid, yeah.

Yeah, regular CSS is a valid SASS file.

JavaScript, 140 143 147 151 153 bytes

   with(document)with(body.appendChild(createElement`canvas`).getContext`2d`)for(i=2;i--;fillRect(i*52,0,26,52))fillStyle=i?"#ef4135":"#0055a4"

Edits

Saved 2 bytes by replacing 2*i*26 with i*52. Thanks to Cᴏɴᴏʀ O'Bʀɪᴇɴ.

Saved 4 bytes by refactoring the for-loop. Thanks to ETHproductions.

Saved 2 bytes by using the with-statement. Thanks to Dendrobium.

Saved 2 bytes by turning increment into decrement. Thanks to Shaun H.

Saved 3 bytes by replacing fillStyle=["#0055a4","#ef4135"][i] with i?"#ef4135":"#0055a4".

2*i*26 can become 52*i, no?

@CᴏɴᴏʀO'Bʀɪᴇɴ Of course it can. Thanks. It's way beyond my bed time.

By simply rearranging the for loop, you can cut 4 bytes: for(i=0;i<2;x.fillRect(i++*52,0,26,52))x.fillStyle=["#0055a4","#ef4135"][i]

@ETHproductions Thanks a lot, I've updated the answer.

You can shave off 2 bytes by using the with statement: with(document)with(body.appendChild(createElement\canvas`).getContext`2d`)for(i=0;i<2;fillRect(i++*52,0,26,52))fillStyle=["#0055a4","#ef4135"][i]`

save a byte:
x=(d=document).body.appendChild(d.createElementcanvas).getContext2d;for(i=3;--i;x.fillRect(i*52,0,26,52))x.fillStyle=[,"#ef4135","#0055a4"][i]

@Dendrobium That's good. Thanks a lot.

@ShaunH I had to write it a bit different, but it saved another 2 bytes. Thanks a lot.

TI-Basic, 52 44 42 bytes
GridOff
AxesOff
11
Shade(-Ans,Ans,Xmin,Xmin/3
Shade(-Ans,Ans,Xmax/3,Xmax,1,1,Ans

(assumes a default [-10,10,1] by [-10,10,1] graph area)
Would be 4 bytes shorter without the first 2 lines, but by default would have axes and would not look as nice.
Looks like this:

If the shading is invalid for the challenge, let me know!
Without the first 2 lines, it looks like this:

I would also include the version without the first three lines just as a comparison.

I think you can just go from Ymin to Ymax. You can also assume a default screen from -10 to 10. I'm also not sure about the validity of this, since the red and blue regions are only half shaded.

@ThomasKwa I edited my post to show why I didn't use just Ymin and Ymax. I didn't realize I could assume a default screen, but you aren't clear about what that default screen is. Could you please clarify? About the "half-shaded" thing, that is just how TI-Basic shades things, if it is invalid, I will promptly change it.

A default screen is Ymin=Xmin=-10, Ymax=Xmax=10. The calculator starts with those window settings, and AxesOn etc, so you can assume them.

This doesn't use the right RGB values, does it?

@Doorknob As far as I know, it's impossible to do that without resorting to witchcraft.

@Doorknob I can verify that. The color tokens represent fixed colors; to change those nothing short of assembly will work.

RED isn't any shorter than 11. Both are 2 bytes. You can also golf by 2 bytes by using 11:Shade(-Ans,Ans,Xmin,Xmin/3:Shade(-Ans,Ans,Xmax/3,Xmax,1,1,Ans.

@ThomasKwa RED is more pretentious though. ;) Thanks for the tips though!

R, 59 bytes
frame();rect(0:2/3,0,1:3/3,1,,,c("#0055a4",0,"#ef4135"),NA)

Output is displayed:

One can also do 49 bytes with
barplot(rep(1,3),,0,col=c("#0055a4",0,"#ef4135"))

if you do not mind the axes and borders:

The ratio seems wrong. I think you have a 2:3 to ratio on a single-colored rectangle instead of a 3:2ratio on the whole flag.

The ratio can be adjusted manually by resizing the plotting window.

To qualify, your entry should work 'out of the box'. Else, anyone can post a 6-pixel solution and say 'You can manually zoom in'.

You say 'axes', I say 'flag pole'.

@sanchises: I'm French and I say f**k it. LIBERTE!

@flodel I give you, f**k it, égalité! :)

Mathematica, 63 94 103 bytes
When I first saw this challenge, I thought Sweet! Mathematica would be perfect for this! until I noticed that built-ins were banned :'(
But wait! I can use bar graphs!
r=RGBColor;BarChart[{1,1,1},ChartStyle->{r@"#0055a4",White,r@"#ef4135"},BarSpacing->0,AspectRatio->2/3]

(Thanks to Martin Büttner for shaving off 5 bytes but adding 16)
Looks like this:

If you add ,Axes->None it looks like this:

If you don't care about the border, you can use this: (95 bytes)
r=RGBColor;BarChart[{1,1},ChartStyle->{r@"#0055a4",r@"#ef4135"},BarSpacing->1,AspectRatio->2/3,Axes->None]

Looks like this:

Without axes:

Axes->None. You should also specifty AspectRatio->2/3. Renaming RGBColor is simple: r=RGBColor;...r["..."]. You can also use prefix-notation to save two more bytes r@"#0055a4".

If you don't need the outline, try BarChart[{1, 1}, ChartStyle -> {RGBColor["#0055a4"], Red}, BarSpacing -> 1].  The Red looks close enough.

@DavidCarraher Meh, since the question specifies a particular RGB value, that one should be used exactly.

My main recommendation was to draw two rectangles, not three.  You are technically correct about Red, however.

Wouldn't the borders around the bars invalidate this solution?

Why not the more direct 65 bytes Image@{{{0,85,164},{6,6,6}!,{239,65,53}}/255}~ImageResize~{78,52}?

Blitz 2D/3D, 154 108 bytes
This produces exactly the same thing as the example given in the question (except for the anti-aliasing at the edges where colors meet).
Graphics 800,533
ClsColor 255,255,255
Cls
Color 0,35,149
Rect 0,0,267,533
Color 237,41,57
Rect 533,0,267,533

Output is displayed and it looks like this:

Javascript (ES6) 117 bytes
Draws it in the console

for(i=c=s=[];i<156;c[i++]=`color:${[,'blue','#fff'][i%3]||(s+=`
`,'red')}`)s+='%c'+'+'.repeat(26);console.log(s,...c)

For 'white' I think it's shorter to do: #fff. Also, the Red and Blue colors must match the colors specified in the spec

You can save a few bytes with i=c=s=[] instead of i=0,c=[],s='' after updating the colours that might help a little...

@Vɪʜᴀɴ When outputting in text, you can use the standard colors (red and blue). It's the 2nd point, counting from the bottom. This is within the spec.

@DomHastings Nice tip, clever use of coercion. Thanks!

@Vɪʜᴀɴ Thanks for the tip, I think the colours are valid because like Ismael said I am using text output. The browser consoles I've tried don't support actual ANSI codes but I've asked for clarification on that.

On Chrome, this comes out at least 2 to 3 times taller than it should be for the 2:3 ratio (I think, at least)

@sysreq Its text in the console... I have no control over your console's lineheight. It's 78 characters wide 52 tall.

This doesn't use the right RGB values nor does it use the standard ANSI colors, does it?

@Doorknob I was under the impression that ANSI has a standardisation of the color names and not the RGB values. That is platform/application independent.

@Doorknob It uses the color red (#F00), white (#FFF) and blue (#00F). If you check the link provided by the O.P., you will notice that those colors are in the "light" line. So, yes, those are valid.

@IsmaelMiguel The question specifies the RGB values that must be used.

@Doorknob I suggest that you read the 2nd point counting from the bottom. It talks about textual output. The colors are fine. Read it and move along. Nothing invalid here.

@IsmaelMiguel This answer does not fall under the category "Alternatively, output a block of text at least 78 characters wide made of non-whitespace characters that depicts the flag, using ANSI color codes to color it. (Use standard blue, white, and red.)" It a.) doesn't use ANSI color codes and b.) doesn't use standard blue, white, and red. Therefore, it has to use the RGB values specified.

@Doorknob It outputs text to a console, using the defined colors. If you wish, ping me on the chat. This discussion is getting pointless pretty quicly. I gave my upvote and I will keep it.

pb, 68 bytes
cw[Y!52]{cccw[X!26]{b[77]>}ccccw[X!52]{b[77]>}cw[X!78]{b[77]>}<[X]v}

Wow, a challenge that pb is actually kinda good for! Those are few and far between.
When I was writing the spec for pb, I included coloured output mostly as a joke. The language was named after a "paintbrush", why would it not do colour? Other than example programs, this is the second time I've ever used it. It is implemented with ANSI codes as the question requires.
I used 'M' as the character to output with because it's fairly dense.
Output:

I resized that screenshot vertically to be two thirds of its height because letters aren't square. The output is 78 by 52, but the original screenshot looks really wrong.
With comments and indentation and junk:
c               # Increase output colour by 1
                # 0 (White) -> 1 (Red)
                # Loop ends with output colour == 1, this is cheaper than
                # setting it back to white every time.

w[Y!52]{        # While the brush's Y coordinate is not 52:
    ccc           # Increase output colour by 3
                    # 1 (Red) -> 4 (Blue)

    w[X!26]{      # While the brush's X coordinate is not 26:
        b[77]       # Write 'M' at the brush's coordinates
        >           # Increase X coordinate by 1
    }

    cccc          # Increase output colour by 4
                    # 4 (Blue) -> 8 mod 8 = 0 (White)

    w[X!52]{      # While the brush's X coordinate is not 52:
        b[77]       # (same as before)
        >
    }

    c             # Increase output colour by 1
                    # 0 (White) -> 1 (Red)

    w[X!78]{      # While the brush's X coordinate is not 78:
        b[77]       # (same as before)
        >
    }

    <[X]          # Set X back to 0
    v             # Increase Y by 1
}

78x30 will get you the dimensions you want for terminal output.

@Mego Yeah, but I'm not sure if it's allowed.

The resulting output on xterm in the default font matches the specified dimensions.

I'd feel weird measuring the size of console output in anything but "characters", though.

When your characters are 1.2x as tall as they are wide, they don't make for very good pixels.

MATLAB, 82 79 78 bytes
x=[0 1 1 0];y(3:4)=2;fill(x,y,[0 85 164]/255,x+1,y,'w',x+2,y,[239 65 53]/255)

Output looks like:

Which version of MATLAB? Doesn't work on r2013a as colours need to be decimal numbers in the range [0,1].

The following line works fill(x,y,[0 85 164]/255,x+1,y,'w',x+2,y,[239 65 53]/255) and saves you 2 bytes. :) I'd also use semi-colons instead of newlines to avoid extra stuff being printed out.

@TomCarpenter I spaced on the 0-1 color scale, it's been a little while since I've had to specify colors. As for the semicolons/newlines, I was choosing readability over console writing, but I've changed my answer

Surely 54...? If you don't want to use default colours you can still save a few bytes (67), by taking some more liberty with the exact RGB values.

Also, in newer versions of Matlab you can use the default colormap for the line colours (lines) to get 68

Just realised one more thing, the background of a figure is already white, therefore 44

C, 115 bytes

#define c"[48;2;%d;%d;%dm%9c"
d=255;main(a){while(a++<9)printf(c c c c,0,85,164,0,d,d,d,0,239,65,53,0,0,0,0,10);}

Contains unprintables:
00000000: 2364 6566 696e 6520 6322 1b5b 3438 3b32  #define c".[48;2
00000010: 3b25 643b 2564 3b25 646d 2539 6322 0a64  ;%d;%d;%dm%9c".d
00000020: 3d32 3535 3b6d 6169 6e28 6129 7b77 6869  =255;main(a){whi
00000030: 6c65 2861 2b2b 3c39 2970 7269 6e74 6628  le(a++<9)printf(
00000040: 6320 6320 6320 632c 302c 3835 2c31 3634  c c c c,0,85,164
00000050: 2c30 2c64 2c64 2c64 2c30 2c32 3339 2c36  ,0,d,d,d,0,239,6
00000060: 352c 3533 2c30 2c30 2c30 2c30 2c31 3029  5,53,0,0,0,0,10)
00000070: 3b7d 0a                                  ;}.

For this program to work, a couple of things need to be true:

The terminal supports the ESC [48;2;<r>;<g>;m "truecolor" escape sequence.
The terminal is not xterm, becase xterm's implementation of the above will produce slightly wrong colors.
The terminal completely ignores NUL characters.

It also looks nicer if your terminal's background is black.
To change to height of the flag, pass command line arguments to  the program. For every argument passed, the flag becomes one line shorter. It's not a bug, it's a feature!
Output:

Had trouble compiling this with gcc (version 5.1.1).  Any specific flags needed to compile?    "a.c:1:10: warning: ISO C99 requires whitespace after the macro name
#define c"\x1b[48;2;%d;%d;%dm"

@Steve is that a warning our an error?

@Steve Just tested it again, gcc 5.2.1. No flags. Produced 12 warnings but made a working binary.

apologies - works fine - got confused by the warnings (and the fact that the code looks pretty cryptic to a C newbie like me)

CSS, 102 110 111 114 bytes

*{background:linear-gradient(90deg,#0055a4 33%,#fff 33%,#fff 66%,#ef4135 66%) 0 0/78px 52px no-repeat

* *{background:linear-gradient(90deg,#0055a4,#0055a4 33%,#fff 33%,#fff 66%,#ef4135 66%) 0 0/78px 52px no-repeat} - one byte shorter

actually a single * is enough :) Thanks!

+1; You could save another byte by removing the trailing }.

You can delete the first color, you save 8 bytes.

You can replace last 66% with 0.

Visual Basic+Excel, 618 137 bytes
Just curious to see how this can be golfed.
EDIT: Curiosity sated, thanks to @Neil and @JimmyJazzx, 618 bytes dropped right down to 137 bytes
Sub a(): Columns("A:C").ColumnWidth = 26: Range("A1:A13").Interior.Color = RGB(0, 85, 164): Range("C1:C13").Interior.Color = RGB(239, 65, 53): End Sub

Recording a macro results in terribly inefficient code. Try Range("A1:C13").Interior.ColorIndex = 5 and Range("G1:I13").Interior.ColorIndex = 3 which seems to suffice.

Sorry, that was Excel 2003, and I forgot to include the ActiveWorkbook.Colors to specify the exact RGB values. Excel 2007 has additional colour options but I don't know them offhand.

I get 137 bytes with a few Quick Changes. I think you can Cut this down more but this is the easy changes.
Sub a():Columns("A:C").ColumnWidth=26:Range("A1:A13").Interior.Color=RGB(0,85,164):Range("C1:C13").Interior.Color=RGB(239,65,53):End Sub

I get 135 with Sub a:Columns("A:C").ColumnWidth=26:Range("A1:A13").Interior.Color=RGB(0,85,164):Range("C1:C13").Interior.Color=RGB(239,65,53):End Sub

iKe, 43 bytes
,(0 0;"|"\"#0055A4|#FFF|#EF4135";52#,&3#26)

This is an example of a "raw tuple" iKe program- it's just a description of an origin (0 0), a palette (3 7#"#0055A4#FFFFFF#EF4135") and a bitmap (+52#'&3#26). You need to wrap a description like this in a function or use references to views if you want to animate it.
The palette is a very simple way of creating a series of CSS colors, hex equivalents of the spec.
  3 7#"#0055A4#FFFFFF#EF4135"
("#0055A4"
 "#FFFFFF"
 "#EF4135")

If the color requirements were less stringent we could use one of iKe's built-in palettes and save a considerable number of characters:
windows@7 0 4

Try it in your browser.
Edit:
Saved one byte by using a short #FFF CSS color for the white stripe:
,(0 0;3 7#"#0055A4#FFFFFF#EF4135";+52#'&3#26)
,(0 0;"|"\"#0055A4|#FFF|#EF4135";+52#'&3#26)

If anyone else is interested in playing with iKe, there's a manual on the github repo. here's another problem I solved using iKe.
Edit 2:
Saved one byte with a simpler way to construct the bitmap:
+52#'&3#26
52#,&3#26

My question in the OP hasn't been answered, but for the record if more flexible color requirements are permitted, this program would be 30 bytes by using the Windows 3.1 palette:
,(0 0;windows@7 0 4;52#,&3#26)

Since this problem was posted, iKe has gained a feature which automatically centers textures drawn without a position, which could save another 3 bytes, but this would be against the rules:
,(;windows@7 0 4;52#,&3#26)

Dyalog APL (47 44)
⎕SM←↑1 21 41{(''⍴⍨2/20)1⍺,⍵,⍨4↑0}¨2*8 11 10

Result:

can you do 2*8 11 10?

@ThomasKwa: thanks

ShaderToy (GLSL), 147 bytes
void mainImage(out vec4 o,vec2 i){float x=i.x/iResolution.x*3.0;vec3 w=vec3(255,255,255);o=vec4((x<1.0?vec3(0,85,164):x<2.0?w:vec3(239,65,53))/w,1);}

See it here
Not particularly exciting. I'm sure there are ways to golf it more; I'll take a crack when I get home.

The link redirects to https://www.shadertoy.com/error :/

A bit shorter version (122 bytes): void mainImage(out vec4 o,vec2 i){o.rgb=vec3[](vec3(0,85,164),vec3(255),vec3(239,65,53))[int(3.*i.x/iResolution.x)]/255.;}

Octave, 77 76 bytes
s(98,49)=0;imshow(cat(3,[s w=s+255 w-18],[s+35 w s+41],[s+149 w s+57])/255);

Displays the image:

Processing, 100 Bytes
size(78,52);background(255);noStroke();fill(#0055A4);rect(0,0,26,52);fill(#EF4135);rect(52,0,26,52);

Displays this:

(The naive solution is shorter than my first one.)

I think Processing's drawing commands can come out ahead of pixel pushing here: size(78,52);noStroke();int[]p={0xFF0055A4,255,0xFFEF4135};for(int c:p){translate(26,0);fill(c);rect(0,0,-26,52);}

@JohnE Lol, yeah i just noticed that.

@JohnE Even my super basic solution is shorter than yours!

haha- looks like we both overcomplicated it

how about abusing the scale instructions? This works on sketchpad.cc but might break in Processing 3: size(78,52);scale(26,52);fill(#EF4135);stroke(#0055A4);rect(0,-1,0,2);stroke(255);rect(1,-1,3,3);

@JohnE It doesn't work when I paste it into Processing, because there seem to be some unprintable characters. I don't really understand what you're doing though. Why are you using stroke()?

By scaling up the canvas I shorten the constants necessary to draw 26x52 rectangles, but also the stroke (which is on by default) will be 26 pixels wide. Thus, instead of drawing a background I can draw two stripes by using the edge of one rectangle. The solution doesn't depend on any unprintable characters, so if there's an issue with that it's just stackoverflow screwing it up.

background(-1) is one byte shorter than background(255)

PHP, 70 bytes
0000000: 424d 0000 0000 0000 0000 2300 0000 0c00  BM........#.....
0000010: 0000 2001 c000 0100 0800 a455 00ff ffff  .. ........U....
0000020: 3541 ef3c 3f66 6f72 283b 3665 343e 2469  5A.<?for(;6e4>$i
0000030: 3b29 6563 686f 2063 6872 2824 692b 2b2f  ;)echo chr($i++/
0000040: 3936 2533 293b                           96%3);

The above is a hexdump which may be reversed with xxd -r. Alternatively, it may also be generated with the following PHP script:
<?=hex2bin('424d0000000000000000230000000c0000002001c00001000800a45500ffffff3541ef3c3f666f72283b3665343e24693b296563686f206368722824692b2b2f39362533293b');

I assume default settings, as they are without an .ini (you may disable your local .ini with the -n option). Produces a .bmp image (288 x 192), which should be piped to a file. This is as large as I can make it without affecting the byte count.

Sample Usage
$ xxd -r in.hex > france.php
$ php -n france.php > out.bmp
$ out.bmp

Output

These colors don't look right. Do they use the RGB values specified in the question?

@Doorknob They do. Starting at byte 26, a three value color palette is defined (bgr): A45500, FFFFFF, 3541EF.

Ruby, 56 47 45 bytes
ASCII
$><<"\e[34z\e[37z\e[31z\n".gsub(?z,?m*27)*52

Yep, this is better than mine. Except the middle bar needs to be white.

@iamnotmaynard True, fixed. Thanks!

ZX Spectrum BASIC, 10 bytes
(including the final end-of-line)
This does not fulfil the minimum flag size requirement, but I like this version, because it is so nice and compact. Please take it as a non-competing entry.

The hexadecimal dump is:
F5 22 10 01 8A 10 02 8A 22 0D
Explanation:
PRINT is a keyword and takes one byte, 0xF5, its graphical representation includes the spaces around. The ZX Spectrum BASIC has one-byte colour codes, introduced by the 0x10 code for the foreground - 01 is for blue, 02 for red.  0x8A is a pseudographical character "▌", the left part of which is displayed in either blue or red.
The colours are of course from the standard ZX Spectrum palette - please adjust your PAL TV if the RGB values are not displayed quite correctly.
Despite the seemingly text mode of the program, the output is fully (bitmapped) graphical, as can be seen by looking into the VideoRAM. Thus there is no need to comply with the ANSI codes requirement, which the ZX does not support anyway (it has superior INK and PAPER commands).

Any chance of a link to an emulator/interpreter?

Presumably a full flag would me something like FOR i=SGN PI TO PI*PI+PI+PI: PRINT "<blue ink>[8 blocks]","<red ink>[8 blocks]": NEXT i

Googly Blockly, 45 blocks

Produces

Try it here

Powershell, 173 bytes, 170 bytes, 155 bytes, 97 bytes!

$i=26;$y=0;function w($c){for($x=0;$x -le $i; $x++){write-host -noNewLine "F" -ForegroundColor $c}}for($x=0;$x -le $i; $x++){w("blue");w("white");w("red");write-host '';}

sal q write-host;$i=26;$y=0;function w($c){for($x=0;$x -le $i; $x++){q -noNewLine F -ForegroundColor $c}}for($x=0;$x -le $i; $x++){w("blue");w("white");w("red");q '';}

(Thanks to Cole Johnson for saving me 15 bytes):
    sal q write-host;$i=26;function w($c){for($x=0;$x -le $i; $x++){q -noNewLine F -ForegroundColor $c}}for($x=0;$x-le$i;$x++){w("blue");w("white");w("red");q}

(Thanks Steve for saving me 58 bytes!!!)
sal q write-host;function w($c){1..26|%{q -noNewLine F -Foreground $c}}1..26|%{w(9);w(7);w(12);q}

Output:

My first code golf, so I hope I didn't do something wrong.

You could trim six bytes by removing the spaces before $x++ (2) and the spaces in $x -le $i (4) making the for declaration for($x=0;$x-le$i;$x++). Four more bytes by replacing q ''; at the end with just q. Also, where is $y used? Removing $y=0 will save you another four. Screenshot of edit

Get rid of $i and make use of 1..26|%{....}, dropping you from 155 bytes to just 115.    sal q write-host;function w($c){1..26|%{q -noNewLine F -ForegroundColor $c}}1..26|%{w("blue");w("white");w("red");q}

Save 5 more by replacing ForegroundColor with the shorter Foreground.

Lose the wordy color descriptions too, use numbers.  All the above then gives you 97 bytes (yay, we broke the 100 barrier!)  sal q write-host;function w($c){1..26|%{q -noNewLine F -Foreground $c}}1..26|%{w(9);w(7);w(12);q}

Wow! I learn more doing code golf than writing code lol.

How about @("█"*26)*30|%{sal w write-host;w $_ -f 9 -n;w $_ -n;w $_ -f 4} at 63 bytes

Unix Shell, 57 bytes.
for i in {a..z}
do printf ␛[4%-28s 4m 7m 1m
echo ␛[m
done

The escapes are in the script literally. On most color terminals you can change 47 to 107 to get a brighter white, but that's not ANSI standard. The script ends up being 61 bytes then. The 28 rather than 26 is because the color code 'steals' two characters from the field width.
Obligatory xxd dump:
0000000: 666f 7220 6920 696e 207b 612e 2e7a 7d0a  for i in {a..z}.
0000010: 646f 2070 7269 6e74 6620 1b5b 3425 2d32  do printf .[4%-2
0000020: 3873 2034 6d20 376d 2031 6d0a 6563 686f  8s 4m 7m 1m.echo
0000030: 201b 5b6d 0a64 6f6e 65                    .[m.done

On a terminal that supports 8-bit control codes it can be made slightly shorter, for 55 bytes.
0000000: 666f 7220 6920 696e 207b 612e 2e7a 7d0a  for i in {a..z}.
0000010: 646f 2070 7269 6e74 6620 9b34 252d 3238  do printf .4%-28
0000020: 7320 346d 2037 6d20 316d 0a65 6368 6f20  s 4m 7m 1m.echo
0000030: 9b6d 0a64 6f6e 65                        .m.done

EDIT: It has come to my attention that ANSI-based solutions are required to draw text in non-white space characters. I have a solution of 65 characters that does so, but I would like someone to explain the reason for the requirement before I post it.

Can you share an xxd dump or base64 decode of this?

@DigitalTrauma I really don't think that should be necessary for only two characters where it's perfectly clear where and what they are, but fine.

Thanks - I asked because it wasn't working for me when copied from this page.  It works great with the xxd dump.  I think the markdown is translating ␛to 0xe2909b, instead of the necessary 0x1b.

@DigitalTrauma I deliberately placed the ␛ symbol to indicate the presence and location of the escape characters, I intended for anyone trying to run this to use their editor's mechanism (^V, ^Q, etc) to replace them with literal escapes. Placing literal escapes on the answer itself caused them not to show up at all.

This doesn't use the correct RGB values, does it?

@Doorknob It uses the ANSI color option... I'd overlooked the non-whitespace requirement (and still don't understand the purpose of it).

Ah, yes, sorry, misread the question (didn't see the "standard ANSI colors" part).

Perl, 90, 50 + 2 (-p flag) = 52 bytes 44 + 2 (-p flag) = 46 bytes
As nobody's done a Perl version yet, here we go:

    $=sprintf "%c[44m%27s%c[47m%27s%c[41m%27s%c[40m\n",27,' ',27,' ',27,' ',27;print $ x 26;

    $x=' ' x 27;$_="^[[44m$x^[[47m$x^[[41m$x^[[40m\n" x 26

$x=' 'x26;$_="^[[44m$x^[[47m$x^[[41m$x^[[0m\n"x26

Hexdump:
00000000: 2478 3d27 2027 7832 363b 245f 3d22 1b5b  $x=' 'x26;$_=".[
00000010: 3434 6d24 781b 5b34 376d 2478 1b5b 3431  44m$x.[47m$x.[41
00000020: 6d24 781b 5b30 6d5c 6e22 7832 360a       m$x.[0m\n"x26.

You don't need the spaces around the x operator. Also, I suggest using 26 instead of 27, since some people still use 80-column terminals.

[0m works better for me since it resets my background to black whereas [40m gives me a very dark sky colour. And it also saves you an extra byte.

Nice answer! I know it's a little old, but you can get it down to 34 with a bit of poking around: https://dom111.github.io/code-sandbox/#eyJsYW5nIjoid2VicGVybC01LjI4LjEiLCJjb2RlIjoic2F5PFx1MDAxYls0ezQsNywxLDl9bT5mb3IoJCw9JFwieDI2KXgyNiIsImFyZ3MiOiItTTUuMTAuMCJ9

Java, 156 bytes
enum F{;public static void main(String[]a){String b="[3";for(int i=0;i<'࿘';i++)System.out.print((i%78<26?b+4:(i%78>51?b+1:b+7))+(i%78>76?"m#\n":"m#"));}}

Used some old tricks like the unicode char used as an int in the loop and so earning a character (but not a byte), modulos (so there's only one loop) and some ternary expressions.
Nothing really special else.

Feel free to revert if you want; I removed your character count because this question is scored by bytes.

x86 machine code, 34 bytes
00000000  68 00 b8 07 bb 40 1f 31  ff 83 e7 f0 89 d8 25 00  |h....@.1......%.|
00000010  f1 c1 c3 04 f6 c4 f0 74  f0 b1 1b f3 ab 85 ff 7f  |.......t........|
00000020  eb c3                                             |..|
00000022

Link to the .COM file - runs just fine in DOSBox:

Notice that it doesn't hang after drawing - it's just that the prompt is left in blue not to ruin the result; you can quit from DOSBox as usual with exit, it'll work even if you don't see it while typing.
Commented assembly:
    ; usual .COM boilerplate
    org 100h

section .text

start:
    ; point the ES segment to the graphics memory
    push 0x0b800
    pop es
    ; bx is used (mainly) as repository for the background colors
    ; 1 => blue; f => white; 4 => red; 0 => flag for new row
    mov bx,0x1f40
    ; reset the destination pointer
    xor di,di
newrow:
    ; === start of a new row ===
    ; round down DI to multiples of 16, to avoid overflowing the row by one
    ; character (27*3 = 81, while the row is 80 characters)
    and di,0xfff0
span:
    ; === start of a span ===
    ; build the pattern to write; start with BX
    mov ax,bx
    ; adjust the pattern in AX:
    ; - keep the upper byte (background color);
    ; - leave blue as foreground color at the very end (avoid the prompt
    ;   ruining the flag when we exit);
    ; - put NUL as character to display;
    and ax,0xf100
    ; rotate bx, to switch to the next color pattern
    rol bx,4
    ; check if we got to the sentinel value (=> we finished one row)
    test ah,0xf0
    ; in this case, go back to newrow; this will re-align DI and do a new
    ; rotation on BX
    jz newrow
    ; fill the video memory with 27 times the word built above in AX
    mov cl,27
    rep stosw
    ; continue as far as DI is positive; notice that this way we keep writing
    ; well past the 25 lines limit, but doesn't seem to impact anything
    test di,di
    jg span
    ; otherwise exit; the point of this thing is to avoid a wraparound, which
    ; ends up unaligned, thus breaking the drawing
    ret

It's backwards. And I don't think the color are right.

@ThomasKwa: sorry, order fixed; the colors are what the nearest that are available in the default VGA palette.

ZX Spectrum Z80 assembly, 32, 30 Bytes
    org 8000h

red:      equ 16
white:    equ 120
blue:     equ 8

start:
    ld    c,16     ;height
    ld    e,8      ; blue/offset/counter
    ld    hl,5800h
sheldon:
    ld    b,e      ;counter
fun:
    ld    (hl),e   ;blue
    inc   hl
    djnz  fun
    ld    b,e      ;counter
with:
    ld   (hl),white
    inc  hl
    djnz with
    ld   b,e       ;counter
flags:
    ld   (hl),red
    inc  hl
    djnz flags
    ld   d,b       ;e holds offset
    add  hl,de
    dec  c
    jr   nz,sheldon
    ret

    end

    30 bytes

output is 24*8 pixels wide =192 pixels wide
and 16*8 pixels high =128 pixels high
edit 1: removed preload of de with two colours,shorter to directly load (hl):saves 1 byte
By not using "de" it can now transfer values instead of "a":saves 1 byte

Marbelous, 122 bytes
@0
--34
=0Ro
\/@0
:Ro
}0
..1B'['0'm0A
Bl1B'['4'1'm
Bl1B'['4'7'm
Bl1B'['4'4'm
{0
:Bl
@0
--1A
=0PS
&0@0
}0
&0
{0
:PS
}0
{0'F

Main board calls Ro 52 times. Ro prints one row including 3 color codes, 3 blocks of spaces, 1 color reset, 1 newline. Bl prints 26 spacesFs. PS prints one space F.

Python, 223 208 bytes
Thanks @Sp3000
from turtle import*
def D():fill(1);fd(100);rt(90);fd(200);rt(90);fd(100);rt(90);fd(200);rt(90);fill(0)
lt(180)
fillcolor("#0055a4")
D()
fillcolor("white")
goto(100,0)
D()
fillcolor("#ef4135")
goto(200,0)
D()

Try it here

Put the entire D function on one line, with semicolons separating each call. That'll shave off 10 bytes. Get rid of the extraneous space between the last setpos and its arguments for an extra byte.

This also doesn't work.

You can remove the space between import and *

@Mego now it does.

@undergroundmonorail it ha already been removed.

Befunge-98, 170 bytes
a"552"a"25 87"a"3P"ck,dd+20pv
_v#p02:-1g02,k8"0 85 164 "  <
v>d6*20p#4
<_v#p02:-1g02,k3"255 "
v >dd+20p
>" 35 56 932"9v>
_v#p02:-1g02,k<^
a<v_@#p29:-1g29,
v >"<"00pdd+20p

Outputs the image in PPM format. It's probably still not optimal.

CBM BASIC 7.0, 76 bytes
1fOi=1to26:?"r←";:goS3:?"e";:goS3:?"£";:goS3:?:nE:end
3fOj=1to26:?" ";:nE:reT

Note that in line 1, the characters between the quotation marks are PETSCII control codes which actually appear in reverse video on a real Commodore computer:

r enables reverse video
← changes the text colour to blue
e changes the text colour to white
£ changes the text colour to red

It's not strictly ANSI, as specified in the question, but given the hardware limitations I think it's close enough. :)
Here is an excerpt of the output on a Commodore 128 80-column display:

Javascript, 91 bytes
Not the most exciting one.
This one only works on Google Chrome. Current version is 46.0.2490.86m.

console.log((Z='%c▮')+Z+Z,(X='font-size:100px;color:#')+'0055a4','color:#fff',X+'ef4135')

This draws the flag in the console.
Google Chrome has a pure white background for the console, and the default font weight allows it to have 33% of it's width.
This uses the BLACK VERTICAL RECTANGLE character to produce the output.

If you don't have Google Chrome, here's the output:

As an alternative, with 84 bytes:

console.log((Z='%c█')+Z+Z,(X='font-size:9cm;color:#')+'0055a4',X+'fff',X+'ef4135')

This one uses the FULL BLOCK UTF8 character (\xDC in ASCII).
It produces a ~13x9cm flag on Chrome's console.
And this is the result:

QBASIC, 88 122 Bytes
SCREEN 13
h=200
a=100
PALETTE 2,856123
PALETTE 1,2626816
LINE(0,0)-(a,h),1,BF
LINE(a,0)-(h,h),15,BF
LINE(h,0)-(300,h),2,BF

Edit: As was correctly pointed out, the colors did not meet the requirements. The corrected version is basically as close as one can get in QB as far as I know, since RGB in mode 13 are represented by 18 bits instead of 24 bit. The colors are (0,85,162), (255,255,255), (239,65,52). So blue is ever so slightly off the mark, but close enough I would say.
Here is it in QB64 (it's getting autoformatted there, but it's the same code):

You could make the image slightly smaller (e.g. 96x64) to save a few bytes. The colors aren't quite right, though.

@primo You are right about the colors. I fixed them as best as possible at the cost of 34 bytes. In the spirit of the underlying occasion of this challange, I ignore the possible 3 saved bytes for the increased size.

CSS, 74 72 bytes
Note: every CSS code is also a valid Sass code: since Sass is a scripting language then this entry should be valid too :)
http://codepen.io/anon/pen/xweEBX?editors=010
*{box-shadow:33.3vw 0 #0055a4 inset,-33.3vw 0 #ef4135 inset;height:66.6vw}

The correct ratio is ensured by the height, expressed as 2/3 of the viewport width (clearly this lacks precision when the viewport is larger than 999px, but at least it is responsive :D )

Edit 1: (72 bytes) from the previous example, a space can be safely removed before each colour.
http://codepen.io/anon/pen/BoEXZP?editors=010
*{box-shadow:33.3vw 0#0055a4 inset,-33.3vw 0#ef4135 inset;height:66.6vw}

Result

Note that with less code (68 bytes, since decimals are not needed in the box-shadow) it is possible to draw the 1853 naval variant, in 30:33:37 proportions, as suggested in a comment above
*{box-shadow:30vw 0#0055a4 inset,-37vw 0#ef4135 inset;height:66.6vw}

To save yet another byte, you can remove the last }. Also, using 66.6% may produce the same result.

CSS, 86 bytes
This creates a simple border around the body element:

body{border-left:2cm solid #0055a4;width:2cm;height:4cm;border-right:2cm solid #ef4135

This renders a 6x4cm flag, and should work on any file.
To test on a clean page, paste this on your address bar:
data:text/html,

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Festival of ASCII-art lights
Write, in as few characters as possible, a program that takes zero or six command-line arguments
menorah
menorah YEAR MONTH DAY HOUR MINUTE SECOND

(Both forms must be supported.  The zero-argument version shall be equivalent to calling the six-argument version with the current system date and time in the local timezone.)
and if the specified (Gregorian-calendar) date and time falls during Hanukkah, then output an ASCII art (or Unicode art) nine-branch menorah with the appropriate number of candles lit.  If it is not during Hanukkah, then output a single newline.  For example,
~$ ./menorah 2015 12 7 0 0 0

    *
    |   *
    |   |
    |   |
+++++++++
    |
   -+-

~$ ./menorah 2015 12 9 0 0 0

    *
    | ***
    | |||
    | |||
+++++++++
    |
   -+-

~$ ./menorah 2015 12 14 0 0 0

    *
****|****
|||||||||
|||||||||
+++++++++
    |
   -+-

~$ ./menorah 2015 12 15 0 0 0
~$

On the Nth day of the festival, N+1 candles are lit: The central shamash candle, and N of the 8 Hanukkah candles, placed in right-to-left order.
Allowed variations in the output format are:

Unused candles may be drawn unlit instead of omitted.
You may use non-ASCII characters to make the result more aesthetically pleasing.  Like  (U+1F525) instead of *.  Or box-drawing characters instead of +-|.

For the purpose of this challenge, a day on the Hebrew calendar may be assumed to start at 18:00.
Results must be correct for Gregorian years between 1900 and 2239, inclusive.

Hanukkah begins at sunset on the Gregorian dates
1900-12-16  1901-12-05  1902-12-24  1903-12-13  1904-12-02  1905-12-22
1906-12-11  1907-11-30  1908-12-18  1909-12-07  1910-12-25  1911-12-15
1912-12-04  1913-12-23  1914-12-12  1915-12-01  1916-12-19  1917-12-09
1918-11-28  1919-12-16  1920-12-05  1921-12-25  1922-12-14  1923-12-02
1924-12-21  1925-12-11  1926-11-30  1927-12-18  1928-12-07  1929-12-26
1930-12-14  1931-12-04  1932-12-23  1933-12-12  1934-12-01  1935-12-20
1936-12-08  1937-11-28  1938-12-17  1939-12-06  1940-12-24  1941-12-14
1942-12-03  1943-12-21  1944-12-10  1945-11-29  1946-12-17  1947-12-07
1948-12-26  1949-12-15  1950-12-03  1951-12-23  1952-12-12  1953-12-01
1954-12-19  1955-12-09  1956-11-28  1957-12-17  1958-12-06  1959-12-25
1960-12-13  1961-12-02  1962-12-21  1963-12-10  1964-11-29  1965-12-18
1966-12-07  1967-12-26  1968-12-15  1969-12-04  1970-12-22  1971-12-12
1972-11-30  1973-12-19  1974-12-08  1975-11-28  1976-12-16  1977-12-04
1978-12-24  1979-12-14  1980-12-02  1981-12-20  1982-12-10  1983-11-30
1984-12-18  1985-12-07  1986-12-26  1987-12-15  1988-12-03  1989-12-22
1990-12-11  1991-12-01  1992-12-19  1993-12-08  1994-11-27  1995-12-17
1996-12-05  1997-12-23  1998-12-13  1999-12-03  2000-12-21  2001-12-09
2002-11-29  2003-12-19  2004-12-07  2005-12-25  2006-12-15  2007-12-04
2008-12-21  2009-12-11  2010-12-01  2011-12-20  2012-12-08  2013-11-27
2014-12-16  2015-12-06  2016-12-24  2017-12-12  2018-12-02  2019-12-22
2020-12-10  2021-11-28  2022-12-18  2023-12-07  2024-12-25  2025-12-14
2026-12-04  2027-12-24  2028-12-12  2029-12-01  2030-12-20  2031-12-09
2032-11-27  2033-12-16  2034-12-06  2035-12-25  2036-12-13  2037-12-02
2038-12-21  2039-12-11  2040-11-29  2041-12-17  2042-12-07  2043-12-26
2044-12-14  2045-12-03  2046-12-23  2047-12-12  2048-11-29  2049-12-19
2050-12-09  2051-11-28  2052-12-15  2053-12-05  2054-12-25  2055-12-14
2056-12-02  2057-12-21  2058-12-10  2059-11-29  2060-12-17  2061-12-07
2062-12-26  2063-12-15  2064-12-03  2065-12-22  2066-12-12  2067-12-01
2068-12-18  2069-12-08  2070-11-27  2071-12-16  2072-12-04  2073-12-24
2074-12-13  2075-12-01  2076-12-20  2077-12-10  2078-11-29  2079-12-17
2080-12-06  2081-12-26  2082-12-15  2083-12-04  2084-12-22  2085-12-11
2086-11-30  2087-12-19  2088-12-07  2089-11-27  2090-12-16  2091-12-05
2092-12-23  2093-12-13  2094-12-02  2095-12-20  2096-12-09  2097-11-29
2098-12-18  2099-12-06  2100-12-26  2101-12-16  2102-12-05  2103-12-23
2104-12-12  2105-12-02  2106-12-21  2107-12-10  2108-11-28  2109-12-17
2110-12-06  2111-12-25  2112-12-13  2113-12-03  2114-12-22  2115-12-10
2116-11-29  2117-12-19  2118-12-08  2119-12-26  2120-12-15  2121-12-04
2122-12-23  2123-12-12  2124-12-01  2125-12-21  2126-12-10  2127-11-29
2128-12-17  2129-12-06  2130-12-24  2131-12-14  2132-12-03  2133-12-22
2134-12-11  2135-11-30  2136-12-18  2137-12-07  2138-12-26  2139-12-15
2140-12-04  2141-12-23  2142-12-12  2143-12-01  2144-12-20  2145-12-09
2146-11-27  2147-12-17  2148-12-05  2149-12-24  2150-12-13  2151-12-03
2152-12-22  2153-12-11  2154-11-30  2155-12-19  2156-12-07  2157-12-25
2158-12-15  2159-12-05  2160-12-23  2161-12-12  2162-12-01  2163-12-20
2164-12-09  2165-11-28  2166-12-16  2167-12-06  2168-12-24  2169-12-13
2170-12-02  2171-12-22  2172-12-10  2173-11-28  2174-12-18  2175-12-08
2176-12-26  2177-12-14  2178-12-04  2179-12-24  2180-12-12  2181-12-01
2182-12-20  2183-12-09  2184-11-28  2185-12-17  2186-12-06  2187-12-25
2188-12-14  2189-12-03  2190-12-21  2191-12-11  2192-11-29  2193-12-17
2194-12-07  2195-12-27  2196-12-15  2197-12-03  2198-12-23  2199-12-13
2200-12-02  2201-12-20  2202-12-10  2203-11-30  2204-12-18  2205-12-07
2206-12-26  2207-12-15  2208-12-03  2209-12-22  2210-12-11  2211-12-01
2212-12-19  2213-12-08  2214-12-27  2215-12-17  2216-12-05  2217-12-23
2218-12-13  2219-12-02  2220-12-20  2221-12-09  2222-11-29  2223-12-18
2224-12-05  2225-12-25  2226-12-15  2227-12-04  2228-12-21  2229-12-11
2230-12-01  2231-12-20  2232-12-08  2233-12-27  2234-12-16  2235-12-05
2236-12-23  2237-12-12  2238-12-02  2239-12-21

For those of us who are not Jewish (and for those who are but don't know how to calculate the Jewish calendar) please explain how the start of Hanukkah is calculated. You should also explain the sequence of lighting the candles (it seems to be one per day, but does it matter which candle you light? )

Are we required to support both zero and six command-line arguments, or can we choose?

@ThomasKwa: Both.  The difference is that the zero-argument version uses the current date and time.

@steveverrill: I've added a list of the relevant Gregorian-calendar dates.  The calendar itself is based on the 19-year Metonic cycle.

Can STDIN be used for languages that don't have command line arguments?

@xnor: Yes.  If your language doesn't support command-line arguments, you may have the user enter the values at runtime (whether through STDIN or through GUI objects).

@GamrCorps I'm casting a reopen vote, as the concerns I had when I cast the first closevote have been addressed. If there is something outstanding, please indicate what it is. Otherwise please don't pile on close votes after the problem is solved. Dan04, Ok I see you have added the list. I had to look up Metonic. So it means the lunar and solar cycles coincide once every 19 years. But not exactly, it seems there is a random(ish) variation by a +/-day every 19 year period.

Beware that drawing unused candles as unlit will be much easier (and I think less interesting) than drawing them as missing.

the option to draw unused candles as unlit means the dynamic ascii art portion of this is just one row of toggled asterisks, which is not interesting at all. not that I find the larger ascii art drawing particularly interesting to begin with.

@Sparr the ascii art portion is far from the most challenging part of this challenge at end, the conversion from gregorian to hebrew Date and checking if we're within the Holidays or not is far more interesting IMO

There is little or no incentive to do the "Aesthetically pleasing" challenge, as it will merely increase bytes.

Mathematica, 376 338 334 bytes
a=Rest@$ScriptCommandLine;b=CalendarConvert[If[a=={},Now~TimeZoneConvert~0,DateObject[FromDigits/@a,TimeZone->0]],j="Jewish"];c=Floor@DateDifference[DateObject[{b[[1,1]],9,25},CalendarType->j,TimeZone->0],b][[1]];d=If[#<=c,"*"," "]&;0<=c<8&&Print["    *
"<>{d/@{7,6,5,4},"|",d/@{3,2,1},"*
|||||||||
|||||||||
+++++++++
    |
   -+-"}]

Runs in a script.

R, 467 bytes
With a little doubt if using a library for the Calendar conversion is allowed or not.
library(ConvCalendar)
f='%Y %m %d %H %M %S'
g='hebrew'
s=' '
if(length(n<-scan())!=6)n=format(Sys.time(),f)
if(n[4]>17)n[3]=n[3]+1
d=strptime(paste(n,collapse=s),f)
h=as.OtherDate(d,g)
i=OtherDate(25,3,h$year,g)
j=round(difftime(d,as.Date(i),,"days"))+1
N=ifelse(j>0&j<10,(1:9)[j],0)
if(!N)write('')else{l='**||+|+'
z=matrix(strsplit(l,'')[[1]],9,7,T)
z[c(1:4,6:9),c(1,6:7)]=s
z[c(4,6),7]='-'
if(N<8)z[1:(9-N),2:4]=s
z[5,2:4]='|'
write(z,'',9,,'')}

Example for input 2015 12 07 00 00 00:
    *
    |   *
    |   |
    |   |
+++++++++
    |
   -+-

My eyes........ :)

APL (Dyalog), 193 bytes
Prompts for input from STDIN and prints to STDOUT.
Uses box drawing characters and an actual lamp symbol!
⎕USING←'System'
→3×(c←+/i≥((⎕NEW Globalization.HebrewCalendar).(ToDateTime 7↑3 23 18,⍨GetYear)i←⎕NEW DateTime(6↑⍎∊⍞'⎕TS')).AddDays¨⍳9)∊⍳8
¯5↑'⍝'
'⍝'@(10-r+5≤r←⍳c)⊢9↑s←¯5↑'│'
9/⍪'││┴'
s
'   ─┴─'

⎕USING←'System' Use .NET
⍳8 first eight ɩntegers
(…)∊ Boolean for whether the following is a member of that:
 ⍳9 first nine integers
 (…).AddDays¨ for each, add that many days to:
  ⎕NEW DateTime(…) a new DateTime .NET object with the value of:
   ⍞'⎕TS' STDIN and expression for current Time Stamp
   ∊ ϵnlist (flatten)
   ⍎ execute (evaluate) that (gives six- or seven-element numeric list)
   6↑ take the first six elements (Y M D h m s)
  i← store as i (for input)
  (⎕NEW Globalization.HebrewCalendar).(…) in a new HebrewCalendar object:
   GetYear get the (Hebrew) year of the input
   3 23 18,⍨ append these (3 month, 23th day, 18th hour — one night before Hanukkah)
   7↑ take the first seven elements, padding with 0s (minutes, seconds)
   ToDateTime convert that Hebrew point in time to normal DateTime object
 i≥ Boolean whether the input is equal to or after each of those
 +/ sum the Booleans
 c← store as c (for count)
3× multiply by three
→ go to that line (3, i.e. next, if Hanukkah; 0, i.e. quit, if not)
¯5↑'⍝' implicitly print the last five characters of the lamp symbol (padding with spaces)
¯5↑'│' last five characters of the middle-candle symbol (padding with spaces)
s← store as s (for stem)
9↑ take the first nine characters from that (padding with spaces)
⊢ yield (separates the above from the below
'⍝'@(…) implicitly print with lamps placed at the following indices:
 ⍳c as many ɩntegers as count of begun Hanukkah days
 r← store in r (for range)
 5≤ Booleans for those larger than or equal to five (to skip the middle candle)
 r+ add to the range of indices
 10- subtract those from ten (to begin at the right)
⍪'││┴' make this string into a column matrix
9/ implicitly print nine horizontal copies of that
s implicitly print the stem
'   ─┴─' implicitly print this string
Example run:
      menorah
2015 12 7 0 0 0
    ⍝
    │   ⍝
│││││││││
│││││││││
┴┴┴┴┴┴┴┴┴
    │
   ─┴─
      menorah
2015 12 9 0 0 0
    ⍝
    │ ⍝⍝⍝
│││││││││
│││││││││
┴┴┴┴┴┴┴┴┴
    │
   ─┴─
      menorah
2015 12 14 0 0 0
    ⍝
⍝⍝⍝⍝│⍝⍝⍝⍝
│││││││││
│││││││││
┴┴┴┴┴┴┴┴┴
    │
   ─┴─
      menorah
2015 12 15 0 0 0

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
Can you win with two more moves at Three Men's Morris?
Bounties
No. 1 (awarded)

I'll throw in 50 rep for the first valid answer

No. 2 (awarded)

I'll throw in another 100 rep for the shortest valid answer.

No. 3 (open for submissions)

I'll throw in 200 rep for the first one with a significant shorter valid answer.
  Significant being at most 45% of currently shortest answer (564 bytes x 0.45 = max 254 bytes).

The Game
You remember the classic game "Nine Men's Morris" or simply "Mill"? There's a variation called Three Men's Morris which is a bit like a mutable tic-tac-toe.
Rules
This is the blank board of the game:
   a   b   c
1 [ ]–[ ]–[ ]
   | \ | / |
2 [ ]–[ ]–[ ]
   | / | \ |
3 [ ]–[ ]–[ ]

[ ] is a field and |–/\ represent routes between those fields.
The game is played by two players 1 and 2 who each place 3 tokens on the board. This actually happened already and we are in the game. The game is won if one player can form a mill which is a vertical or horizontal row of the player's 3 tokens.
Tokens can be moved on the board along the connecting lines, according to this rule:

To any adjacent empty position (i.e. from an edge position to the center, or from the center to an edge position, or from an edge position to an adjacent edge position

A player must make a move unless there's no adjacent empty position, in which case the move is skipped.
The Challenge
You're player 1 and your move is next. Write a program or a function, that determines whether:

you can force a win with 2 or less moves (definite win)
you can win with 2 or less moves, if your opponent makes a mistake (possible win)
you cannot win with 2 or less moves, because you'll need more moves or because forced moves lead your opponent to win (impossible to win)

Requirements

Even though you definitely win when you bore your opponent to death, your program must finish in finite time.
You can write a program or a function.

Input
The players are represented by 1 and 2. 0 defines a free field. You can take input as a matrix or an array.
Definite
A         B         C         D
2 1 0  |  2 1 0  |  1 0 1  |  1 2 2
2 1 2  |  0 1 0  |  1 0 2  |  2 1 O
0 0 1  |  2 2 1  |  0 2 2  |  O O 1

A: [2,1,0,2,1,2,0,0,1]
B: [2,1,0,0,1,0,2,2,1]
C: [1,0,1,1,0,2,0,2,2]
D: [1,2,2,2,1,0,0,0,1]

Possible
A         B         C
1 0 1  |  1 0 1  |  1 2 2
1 2 2  |  1 2 0  |  0 0 1
2 0 0  |  2 0 2  |  2 1 0

A: [1,0,1,1,2,2,2,0,0]
B: [1,0,1,1,2,0,2,0,2]
C: [1,2,2,0,0,1,2,1,0]

Impossible
A         B
1 0 0  |  1 2 0
1 2 2  |  2 1 0
2 0 1  |  1 2 0

A: [1,0,0,1,2,2,2,0,1]
B: [1,2,0,2,1,0,1,2,0]

Output
Your program should output/return a smiley:

Definite win: :)
Possible win: :|
Impossible to win: :(

Examples
Definite win in two moves:
[2][1][ ] 1. [2][1][ ]
[2][1][2] -> [2][1][2]
[ ][ ][1]    [ ][1][ ]

[2][1][ ] 1. [2][1][ ]    [ ][1][ ] 2. [ ][ ][1]
[ ][1][ ] -> [ ][ ][1] -> [2][ ][1] -> [2][ ][1]
[2][2][1]    [2][2][1]    [2][2][1]    [2][2][1]

[1][ ][1] 1. [ ][1][1]    [ ][1][1] 2. [1][1][1]
[1][ ][2] -> [1][ ][2] -> [1][ ][2] -> [ ][ ][2]
[ ][2][2]    [ ][2][2]    [2][ ][2]    [2][ ][2]

Possible win in two moves:
[1][ ][1] 1. [ ][1][1]    [ ][1][1] 2. [1][1][1]
[1][2][ ] -> [1][2][ ] -> [1][2][2] -> [ ][2][2]
[2][ ][2]    [2][ ][2]    [2][ ][ ]    [2][ ][ ]

[1][ ][1] 1. [ ][1][1]    [ ][1][1] 2. [1][1][1]
[1][2][ ] -> [1][2][ ] -> [1][2][2] -> [ ][2][2]
[2][ ][2]    [2][ ][2]    [2][ ][ ]    [2][ ][ ]

[1][2][2] 1. [ ][2][2]    [2][ ][2] 2. [1][2][2]
[ ][ ][1] -> [1][ ][1] -> [1][ ][1] -> [1][1][1]
[2][1][ ]    [2][1][ ]    [2][1][ ]    [2][ ][ ]

Impossible to win in two moves:
[1][ ][ ]
[1][2][2]
[2][ ][1]

Bonus
In case a definite win is possible and your program outputs the moves of one way to success as well like a1:a2 (1 move) or a1:a2,a3:b2 (2 moves), you can withdraw 30% of your byte count.

This is code golf – so shortest answer in bytes wins. Standard loopholes are disallowed.

Thanks to Peter Taylor who fixed some flaws and improved wording in the Sandbox.

Related .

I like those ascii tables/graphics=)

What happens if a player is unable to move? e.g. in [1,0,0,2,1,0,2,2,1], player 2 cannot move - is this a win for player 1?

@VisualMelon Good addition. I've edited it into the question: "A player must make a move unless there's no adjacent empty position, in which case the move is skipped.".

Impossible test case C looks like it's a definite win to me (6->4, 4->2) and Impossible B looks like a possible.

@VisualMelon but cant you move diagonally? so it comes out to     [1,2,0,0,1,0,2,2,1] ?

@VisualMelon You're right, impossible C was a definite win. I removed it. I also updated impossible B. It's hard to find impossible variants.

@VisualMelon I believe the state you give is (modulo symmetries) the only in which a player can't move. But the other has already won!

@LeifWillerts I might be misunderstanding what you mean, but in that case, no player is in a winning state - they only win by having a horizontal or vertical line (not diagonal).

uhm actually thinking about it, there is no impossible win, considering player 2 is stupid enough there is always a possibility to win

i take it back, i misread the rules

Well, there are only 1680 valid board positions, so hardcoding can give a little over 210 bytes. (fewer if symmetry is considered)

Curious, how to go from 1680 to 210?

Haskell, 580 564 441 bytes
This is how far I can golf it for now. Not sure if the other languages can beat it.
Call m on a list of lists like [[2,1,0],[2,1,2],[0,0,1]] (Definite A).
import Data.Array
r=[0..2]
p?f=[(x,y)|x<-r,y<-r,f!y!x==p]
p%f=all(==x)xs||all(==y)ys where(x:xs,y:ys)=unzip$p?f
s p x y f=f//[(y,f!y//[(x,p)])]
p#f=[s 0 x y$s p u v f|a@(x,y)<-p?f,b@(u,v)<-0?f,((x-u)*(y-v)==0&&abs(x+y-u-v)==1)||elem(1,1)[a,b]]
p&f|p#f>[]=p#f|0<1=[f]
e=any
i a p f=e(a$e(p%))(map(map(p&))(map((3-p)&)$p&f))||e(p%)(p&f)
l=listArray(0,2)
f(True,_)=":)"
f(False,True)=":|"
f _=":("
m=putStrLn.f.(\f->(i all 1 f,i e 1 f)).l.map l

Test code:
da = [[2,1,0],[2,1,2],[0,0,1]]
db = [[2,1,0],[0,1,0],[2,2,1]]
dc = [[1,0,1],[1,0,2],[0,2,2]]
dd = [[1,2,2],[2,1,0],[0,0,1]]
pa = [[1,0,1],[1,2,2],[2,0,0]]
pb = [[1,0,1],[1,2,0],[2,0,2]]
pc = [[1,2,2],[0,0,1],[2,1,0]]
ia = [[1,0,0],[1,2,2],[2,0,1]]
ib = [[1,2,0],[2,1,0],[1,2,0]]
al = [da,db,dc,dd,pa,pb,pc,ia,ib]

mapM_ m al returns:
:)
:)
:)
:)
:|
:|
:|
:(
:(

Corrected, I think. Will doublecheck and properly golf in the evening (which here is before the grace period ends)

C# - 739 663 bytes
Complete program, reads input from argv, and appears to work. Run it like
ThreeMill 1 2 1 1 2 0 0 0 2

If this method of input is unacceptable, I'll be glad to change it (never like using argv).
using System;using System.Linq;class P{static void Main(string[]A){var I=new[]{0,3,6,1,4,7,2,5,8};Func<string[],string>J=S=>S[0]+S[1]+S[2]+" "+S[3]+S[4]+S[5]+" "+S[6]+S[7]+S[8]+" ";Func<string[],string,int>W=(B,p)=>(J(B)+J(I.Select(i=>B[i]).ToArray())).Contains(p+p+p)?1:0;Func<string[],string,string[][]>V=(B,p)=>I.SelectMany(a=>I.Where(b=>a!=b&B[a]==p&B[b]=="0"&(a==4|b==4|a-b==3|b-a==3|((a-b==1|b-a==1)&a/3==b/3))).Select(b=>{var N=(string[])B.Clone();N[b]=p;N[a]="0";return N;})).DefaultIfEmpty(B).ToArray();int h,G;Console.WriteLine(":"+"(|))"[V(A,"1").Max(z=>((h=0)<(G=V(z,"2").Sum(j=>V(j,"1").Max(q=>W(q,"1")-W(q,"2"))+h++*0))?1:0)+(h>G?W(z,"1")*2:2))]);}}

I was disinclined to post this yesterday, because I've not been able to golf it down much (not had all that much time, and I might be out of practice), but since there hasn't been a response yet, I'll post it anyway, I certainly don't expect the bounty, I'd rather it went to someone who's put a bit more effort into theirs before posting!
Edit: replaced all the bools with ints, which meant I could make better use of Linq, and managed to collapse both foreach loops, giving big savings. I am slightly amazed that the h counter works... ++ is such a subtle utility.
The program is very simple, it just explores every possible set of moves (stores board state in a string[]). It iterates over all of our possible moves (the boards that result thereof), and counts the number of responses by our opponent that we can successful beat (G) (i.e. those that we win, and he doesn't). It also counts the number of possible responses (h). If we can win any, then it's a possible, and we add 1 to the sum, if we can win them all, it's a definite, and we add 2 to the sum. The maximum some is therefore our best possible outcome, and we index into the string "(|))" to return the appropriate face. Note that we need the extra ")" because the sum can be 2 or 3 if it's a definite (it's possible that we don't appear to be able to beat any responses having already won on the first go, so the possible check is a tad misleading).
The program checks for a victory by producing a string from the board, that is space-separated rows and columns, and just looks for a string of 3 of the player's character in this string (e.g. "201 201 021 220 002 111 " is a win for us)
using System;
using System.Linq; // all important

class P
{
    static void Main(string[]A) // transform to int?
    {
        var I=new[]{0,3,6,1,4,7,2,5,8}; // vertical indexes
        Func<string[],string>J=S=>S[0]+S[1]+S[2]+" "+S[3]+S[4]+S[5]+" "+S[6]+S[7]+S[8]+" "; // joins the strings up, so that there is a space separating each group of three (including at end)
        Func<string[],string,int>W=(B,p)=>(J(B)+J(I.Select(i=>B[i]).ToArray())).Contains(p+p+p)?1:0; // checks if a particular player wins
        Func<string[],string,string[][]>V=(B,p)=>I.SelectMany(a=>I // for each imagineable move
            .Where(b=>a!=b&B[a]==p&B[b]=="0"&(a==4|b==4|a-b==3|b-a==3|((a-b==1|b-a==1)&a/3==b/3))) // where it's legal
            .Select(b=>{var N=(string[])B.Clone();N[b]=p;N[a]="0";return N;}) // select the resulting board
        ).DefaultIfEmpty(B) // allow not-moving
        .ToArray();

        int h, // h stores the number of responses the opponent has to each move
        G; // G stores the number of responses by the opponent we can beat

        Console.WriteLine(":"+"(|))"[ // we index into this to decide which smiley
            V(A,"1").Max(z=>
                    ((h=0)<(G=V(z,"2").Sum(j=>V(j,"1").Max(q=>W(q,"1")-W(q,"2"))+h++*0))?1:0) // if there is atleast 1 reponse by the opponent we can beat, we can possibly win
                    +(h>G?W(z,"1")*2:2) // if there are moves which we can't win, then if we have already won (one-move), else, we can definitely win
                   ) // sum is therefore 0 if impossible, 1 if possible, >2 (no more than 3) if definite
            ]);

    }
}

Here is my test script:
ThreeMill 2 1 0 2 1 2 0 0 1
ThreeMill 2 1 0 0 1 0 2 2 1
ThreeMill 1 0 1 1 0 2 0 2 2
ThreeMill 1 2 2 2 1 0 0 0 1

ThreeMill 1 0 1 1 2 2 2 0 0
ThreeMill 1 0 1 1 2 0 2 0 2
ThreeMill 1 2 2 0 0 1 2 1 0

ThreeMill 1 0 0 1 2 2 2 0 1
ThreeMill 1 2 1 1 2 0 0 0 2
ThreeMill 1 0 1 2 0 2 1 0 2

Which outputs
:)
:)
:)
:)
:|
:|
:|
:(
:|
:)

Nice. Thanks for being the first. :) If it's ok, I'll award the bounty after the weekend, to keep it a few more days in the featured tab.

@insertusernamehere That's fine by me, if I can't be bothered to do any real work, I might do some more work on this tomorrow.

This reminds me of this comment: "I've not been able to answer a question for FORTY MINUTES. This is critical! Just send over database details and I'll SQL insert my answers. I have so much work to avoid and no reason to avoid it!!" on Why is Stack Overflow not working?. :)

Python 3, 566 557 bytes
I'll have to see if I can golf it down further, or if I can get the 30% bonus, but after much procrastination, here is my answer.
def t(g,x=1,r=0,z=0):
 m=[[1,3,4],[0,2,4],[2,4,5],[0,4,6],[0,1,2,3,5,6,7,8],[2,4,8],[3,4,7],[4,6,8],[4,5,7]];a=[[0,1,2],[3,4,5],[6,7,8],[0,3,6],[1,4,7],[2,5,8],[0,4,8],[2,4,6]];z=z or[[],[],[],[]];s=0
 if r>3:return z
 for i in a:
  if g[i[0]]==g[i[1]]==g[i[2]]>0:s=g[i[0]];break
 z[r]+=s,
 for q in range(9):
  i=g[q]
  if i==x:
   for p in m[q]:
    if g[p]<1:n=g[:];n[q],n[p]=n[p],n[q];z=t(n,3-x,r+1,z)
 if r:return z
 else:
  w=l=0
  for j in range(4):w=w or 1in z[j];l=l or 2in z[j]
  if l<1and w:return":)"
  elif w<1and l:return":("
  else:return":|"

Ungolfed:
def three_mens_morris(grid, player=1, rec=0, w_l=0, p=0):
    moves = [[1,3,4],[0,2,4],[2,4,5],[0,4,6],[0,1,2,3,5,6,7,8],[2,4,8],[3,4,7],[4,6,8],[4,5,7]]
    w_l = w_l or [[],[],[],[]]
    if rec == 4: return w_l
    result = check_grid(grid)
    w_l[rec].append(result)
    for sq_1 in range(len(grid)):
        piece = grid[sq_1]
        if piece == player:
            for sq_2 in moves[sq_1]:
                if grid[sq_2] == 0:
                    new_grid = grid.copy()
                    new_grid[sq_1],new_grid[sq_2]=new_grid[sq_2],new_grid[sq_1]
                    w_l = three_mens_morris(new_grid,3-player,rec+1,w_l)
    if p: print(w_l)
    if rec:
        return w_l
    else:
        win = loss = 0
        for i in range(4):
            if 1 in w_l[i]:
                win = 1
            elif 2 in w_l[i]:
                loss = 1
        if p:print(win,loss)
        if loss==0 and win:
            return ":)"
        elif loss and win==0:
            return ":("
        else:
            return ":|"

def check_grid(grid):
    rows = [[0,1,2],[3,4,5],[6,7,8],[0,3,6],[1,4,7],[2,5,8],[0,4,8],[2,4,6]]
    for i in rows:
        if grid[i[0]]==grid[i[1]]==grid[i[2]] and grid[i[0]]:
            return grid[i[0]]
    return 0

PowerShell 576 550 bytes
I shall not be so easily deterred - if I can't get C# below 631 bytes, I'll have to use a different language instead! I'm hoping that Leif Willerts will knock 5 bytes off his answer, because I've decided I'm not overly fond of PowerShell, maybe I just need to look at it objectively in terms in byte counts...
This is a script, you run it by . .\mill.ps1 "201102021". It's pretty well a copy of my C# answer, only in a language I've little experience with. I've not made too much of an effort to golf this, because it took so bloomin' long to get working in the first instance, and is reasonably compact already.
Edit: couldn't just leave those [Math]::Floor calls in there
param($U);$I=0,3,6,1,4,7,2,5,8;function J($S){($S[0..2]+" "+$S[3..5]+" "+$S[6..8]-join"").Contains($p*3)}function W($D,$p){(J $D)-or(J $D[$I])}function V($Q,$C){$I|%{$a=$_;$I|?{$a-ne$_-and$Q[$a]-eq$c-and$Q[$_]-eq"0"-and($a-eq4-or$_-eq4-or$a-$_-eq3-or$_-$a-eq3-or(($a-$_-eq1-or$_-$a-eq1)-and$a/3-$a%3/3-eq$_/3-$_%3/3))}|%{$b=$Q[0..8];$b[$_]=$c;$b[$a]=0;$b-join''}}|%{$n=1}{$n=0;$_}{if($n){$Q}}}$e=$f=0;V $U "1"|%{$h=0;$x=$_;V $x "2"|%{$k=0;(V $_ "1"|%{if((W $_ "1")-and!(W $_ "2")){$k=$e=1}});$h+=1-$k};if($h-eq0-or(W $x "1")){$f=2}};":"+"(|))"[$e+$f]

If you a description of how it works... the C# answer is for you, but hopefully the comments make it clear enough. The semicolons may not match perfectly with the single-line command, I'm not sure yet where they are needed and aren't, and didn't copy them back when I put the whole thing on one line.
param($U); # take input as argument

$I=0,3,6,1,4,7,2,5,8; # cols

function J($S){ # checks if this is a winning string
($S[0..2]+" "+$S[3..5]+" "+$S[6..8]-join"").Contains($p*3)}

function W($D,$p){ # checks if this is a winning board
(J $D)-or(J $D[$I])} # $D[$I] reorganises into columns

function V($Q,$C){ # yields all valid moves from position $Q for player $C
$I|%{$a=$_;$I| # for each possible move
?{$a-ne$_-and$Q[$a]-eq$c-and$Q[$_]-eq"0"-and($a-eq4-or$_-eq4-or$a-$_-eq3-or$_-$a-eq3-or(($a-$_-eq1-or$_-$a-eq1)-and$a/3-$a%3/3-eq$_/3-$_%3/3))}| # where legal
%{$b=$Q[0..8];$b[$_]=$c;$b[$a]=0;$b-join''}}| # make the move (copy $Q to an array, modify, join into a string)
%{$n=1}{$n=0;$_}{if($n){$Q}}} # if empty, return $Q - I am confident this can be achieved with commas, and [0], and maybe a +, but I don't want to think about it

$e=$f=0; # possible, definite

V $U "1"|%{ # for all our possible moves
$h=0;$x=$_; # $k is whether we win all of these
  V $x "2"| # for all opponent's responses
  %{$k=0;(V $_ "1"| # for all our responses
  %{if((W $_ "1")-and!(W $_ "2")){$k=$e=1}});$h+=1-$k}; # if we can win and he can't, then things are looking good, set $e to 1 (possible win)

  if($h-eq0-or(W $x "1")){$f=2} # if we win every move, or we have already won, it's a definite
};

":"+"(|))"[$e+$f] # smile, it's all over

Test script (PowerShell):
. .\mill.ps1 "210212001"
. .\mill.ps1 "210010221"
. .\mill.ps1 "101102022"
. .\mill.ps1 "122210001"

. .\mill.ps1 "101122200"
. .\mill.ps1 "101120202"
. .\mill.ps1 "122001210"

. .\mill.ps1 "100122201"
. .\mill.ps1 "121120002"
. .\mill.ps1 "101202102"

. .\mill.ps1 "100122201"
. .\mill.ps1 "120210120"

Output thereof:
:)
:)
:)
:)
:|
:|
:|
:(
:|
:)
:(
:(

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/