Changes in uspace/lib/gfx/src/color.c [a3f63ac:211fd68] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/gfx/src/color.c
ra3f63ac r211fd68 1 1 /* 2 * Copyright (c) 20 19Jiri Svoboda2 * Copyright (c) 2024 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 64 64 color->g = g; 65 65 color->b = b; 66 color->attr = 0xff; 67 68 *rcolor = color; 69 return EOK; 70 } 71 72 /** Create new EGA color. 73 * 74 * @param attr EGA attributes 75 * @param rcolor Place to store pointer to new color 76 * 77 * @return EOK on success or an error code, ENOMEM if out of resources, 78 * EIO if the graphic device connection was lost 79 */ 80 errno_t gfx_color_new_ega(uint8_t attr, gfx_color_t **rcolor) 81 { 82 gfx_color_t *color; 83 84 color = calloc(1, sizeof(gfx_color_t)); 85 if (color == NULL) 86 return ENOMEM; 87 88 color->attr = attr; 66 89 67 90 *rcolor = color; … … 93 116 } 94 117 118 /** Convert color to EGA attributes. 119 * 120 * @param color Color 121 * @param attr Place to store EGA attributes 122 */ 123 void gfx_color_get_ega(gfx_color_t *color, uint8_t *attr) 124 { 125 *attr = color->attr; 126 } 127 95 128 /** @} 96 129 */
Note:
See TracChangeset
for help on using the changeset viewer.