Changeset 9259d20 in mainline for uspace/lib/gfx/src/color.c


Ignore:
Timestamp:
2019-04-16T09:15:55Z (6 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3e828ea
Parents:
045186b
git-author:
Jiri Svoboda <jiri@…> (2019-04-15 17:15:29)
git-committer:
Jiri Svoboda <jiri@…> (2019-04-16 09:15:55)
Message:

Drawing rectangles in the console

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/gfx/src/color.c

    r045186b r9259d20  
    3636#include <gfx/color.h>
    3737#include <stdint.h>
     38#include <stdlib.h>
     39#include "private/color.h"
    3840
    3941/** Create new 16-bit per channel RGB color.
     
    5355    gfx_color_t **rcolor)
    5456{
     57        gfx_color_t *color;
     58
     59        color = calloc(1, sizeof(gfx_color_t));
     60        if (color == NULL)
     61                return ENOMEM;
     62
     63        color->r = r;
     64        color->g = g;
     65        color->b = b;
     66
     67        *rcolor = color;
    5568        return EOK;
    5669}
     
    6275void gfx_color_delete(gfx_color_t *color)
    6376{
    64         (void) color;
     77        free(color);
    6578}
    6679
Note: See TracChangeset for help on using the changeset viewer.