Skip to content

Commit

Permalink
Simplify color sequences definition in IO.ANSI
Browse files Browse the repository at this point in the history
  • Loading branch information
lexmag committed Dec 9, 2014
1 parent 4a535cf commit 70d528f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/elixir/lib/io/ansi.ex
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,8 @@ defmodule IO.ANSI do
defsequence :blink_off, 25

colors = [:black, :red, :green, :yellow, :blue, :magenta, :cyan, :white]
colors = Enum.zip(0..(length(colors)-1), colors)

for {code, color} <- colors do
for {color, code} <- Enum.with_index(colors) do
@doc "Sets foreground color to #{color}"
defsequence color, code + 30

Expand Down

0 comments on commit 70d528f

Please sign in to comment.