{ran} color fix (no black)

This commit is contained in:
Jack Halford 2017-03-11 16:06:22 +01:00
parent 81c7802c71
commit 89dd2d63f3
4 changed files with 6 additions and 6 deletions

View file

@ -6,7 +6,7 @@
/* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */ /* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/07 13:49:04 by jhalford #+# #+# */ /* Created: 2016/11/07 13:49:04 by jhalford #+# #+# */
/* Updated: 2017/03/10 16:52:40 by jhalford ### ########.fr */ /* Updated: 2017/03/11 13:13:18 by jhalford ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */ /* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/07 13:31:48 by jhalford #+# #+# */ /* Created: 2016/11/07 13:31:48 by jhalford #+# #+# */
/* Updated: 2017/03/10 16:58:21 by jhalford ### ########.fr */ /* Updated: 2017/03/11 13:14:19 by jhalford ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */ /* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/07 13:33:27 by jhalford #+# #+# */ /* Created: 2016/11/07 13:33:27 by jhalford #+# #+# */
/* Updated: 2017/03/10 16:54:15 by jhalford ### ########.fr */ /* Updated: 2017/03/11 13:14:24 by jhalford ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */ /* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/06 18:07:39 by jhalford #+# #+# */ /* Created: 2016/12/06 18:07:39 by jhalford #+# #+# */
/* Updated: 2017/03/10 16:58:51 by jhalford ### ########.fr */ /* Updated: 2017/03/11 14:00:20 by jhalford ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -14,13 +14,13 @@
t_stos g_colors[] = t_stos g_colors[] =
{ {
{"{bla}", FG_BLACK},
{"{red}", FG_RED}, {"{red}", FG_RED},
{"{gre}", FG_GREEN}, {"{gre}", FG_GREEN},
{"{yel}", FG_YELLOW}, {"{yel}", FG_YELLOW},
{"{blu}", FG_BLUE}, {"{blu}", FG_BLUE},
{"{mag}", FG_MAGENTA}, {"{mag}", FG_MAGENTA},
{"{cya}", FG_CYAN}, {"{cya}", FG_CYAN},
{"{bla}", FG_BLACK},
{"{eoc}", FG_DEFAULT}, {"{eoc}", FG_DEFAULT},
{"{bol}", ON_BOLD}, {"{bol}", ON_BOLD},
{"{und}", ON_UNDERLINED}, {"{und}", ON_UNDERLINED},
@ -35,7 +35,7 @@ void ft_printf_color(char **final, char **str, va_list ap)
i = 0; i = 0;
if (ft_strncmp(*str, "{ran}", 5) == 0) if (ft_strncmp(*str, "{ran}", 5) == 0)
{ {
i = va_arg(ap, int) % 7 + 1; i = va_arg(ap, int) % 6;
*final = ft_strjoin(*final, g_colors[i].val); *final = ft_strjoin(*final, g_colors[i].val);
*str += 5; *str += 5;
return ; return ;