|
XenevaOS
|


Go to the source code of this file.
Macros | |
| #define | WHITE 0xFFFFFFFF |
| Color codes. | |
| #define | SILVER 0xFFC0C0C0 |
| #define | GRAY 0xFF808080 |
| #define | BLACK 0xFF000000 |
| #define | RED 0xFFFF0000 |
| #define | MAROON 0xFF800000 |
| #define | YELLOW 0xFFFFFF00 |
| #define | OLIVE 0xFF808000 |
| #define | LIME 0xFF00FF00 |
| #define | GREEN 0xFF008000 |
| #define | AQUA 0xFF00FFFF |
| #define | TEAL 0xFF008080 |
| #define | BLUE 0xFF0000FF |
| #define | NAVY 0xFF000080 |
| #define | FUCHSIA 0xFFFF00FF |
| #define | PURPLE 0xFF800080 |
| #define | DARKRED 0xFF8B0000 |
| more colors are needed!! | |
| #define | BROWN 0xFFA52A2A |
| #define | FIREBRICK 0xFFB22222 |
| #define | CRIMSON 0xFFDC143C |
| #define | TOMATO 0xFFFF6347 |
| #define | CORAL 0xFFFF7F50 |
| #define | INDIANRED 0xFFCD5C5C |
| #define | LIGHTCORAL 0xFFF08080 |
| #define | DARKSALMON 0xFFE9967A |
| #define | SALMON 0xFFFA8072 |
| #define | ORANGERED 0xFFFF4500 |
| #define | DARKORANGE 0xFFFF8C00 |
| #define | ORANGE 0xFFFFA500 |
| #define | GOLD 0xFFFFD700 |
| #define | DARKGOLDENROD 0xFFB8860B |
| #define | GOLDENROD 0xFFDAA520 |
| #define | PALEGOLDENROD 0xFFEEE8AA |
| #define | DARKKHAKI 0xFFBDB76B |
| #define | KHAKI 0xFFF0E68C |
| #define | DARKGREEN 0xFF006400 |
| #define | PALEGREEN 0xFF98FB98 |
| #define | LIGHTSILVER 0xFFD9D9D9 |
| #define | DESKBLUE 0xFF5B7492 |
| #define | MENUCLICKBLUE 0xFF6A7298 |
| #define | TITLEBAR_DARK 0xFF2F2F2F |
| #define | LIGHTBLACK 0xFF3E3E3E |
| #define | MAGENTA 0xFFFF00FF |
| #define | CYAN 0xFF00FFFF |
| #define | SET_ALPHA(color, alpha) (((color << 8) >> 8) | ((alpha << 24) & 0xff000000)) |
| #define | _RED(color) ((color & 0x00FF0000) / 0x10000) |
| #define | _GRE(color) ((color & 0x0000FF00) / 0x100) |
| #define | _BLU(color) ((color & 0x000000FF) / 0x1) |
| #define | _ALP(color) ((color & 0xFF000000) / 0x1000000) |
| #define | GET_ALPHA(color) ((color >> 24) & 0x000000FF) |
| #define | GET_RED(color) ((color >> 16) & 0x000000FF) |
| #define | GET_GREEN(color) ((color >> 8) & 0x000000FF) |
| #define | GET_BLUE(color) ((color >> 0) & 0x000000FF) |
Functions | |
| XE_LIB uint32_t | ChColorAlphaBlend (uint32_t oldColor, uint32_t color2, double opacity) |
| XE_LIB uint32_t | ChColorAlphaBlend2 (uint32_t color1, uint32_t color2) |
| XE_LIB void | ChColorDrawVerticalGradient (ChCanvas *canv, int x, int y, int w, int h, uint32_t color1, uint32_t color2) |
| uint32_t | make_col (uint8_t red, uint8_t green, uint8_t blue) |
| uint32_t | make_col_a (uint8_t red, uint8_t green, uint8_t blue, uint8_t a) |
| XE_LIB void | ChColorDrawHorizontalGradient (ChCanvas *canv, int x, int y, int w, int h, uint32_t color1, uint32_t color2) |
| XE_LIB double | clamp (double x, double upper, double lower) |
| XE_LIB uint32_t | ChColorRGBAtoBGRA (uint32_t col) |
| XE_LIB void | ChDrawPixelRAW (ChCanvas *canvas, int x, int y, uint32_t color) |
| ChDrawPixelRAW – draws a pixel to canvas buffer. | |
| #define _ALP | ( | color | ) | ((color & 0xFF000000) / 0x1000000) |
| #define _BLU | ( | color | ) | ((color & 0x000000FF) / 0x1) |
| #define _GRE | ( | color | ) | ((color & 0x0000FF00) / 0x100) |
| #define _RED | ( | color | ) | ((color & 0x00FF0000) / 0x10000) |
| #define AQUA 0xFF00FFFF |
| #define BLACK 0xFF000000 |
| #define BLUE 0xFF0000FF |
| #define BROWN 0xFFA52A2A |
| #define CORAL 0xFFFF7F50 |
| #define CRIMSON 0xFFDC143C |
| #define CYAN 0xFF00FFFF |
| #define DARKGOLDENROD 0xFFB8860B |
| #define DARKGREEN 0xFF006400 |
| #define DARKKHAKI 0xFFBDB76B |
| #define DARKORANGE 0xFFFF8C00 |
| #define DARKRED 0xFF8B0000 |
more colors are needed!!
| #define DARKSALMON 0xFFE9967A |
| #define DESKBLUE 0xFF5B7492 |
| #define FIREBRICK 0xFFB22222 |
| #define FUCHSIA 0xFFFF00FF |
| #define GET_ALPHA | ( | color | ) | ((color >> 24) & 0x000000FF) |
| #define GET_BLUE | ( | color | ) | ((color >> 0) & 0x000000FF) |
| #define GET_GREEN | ( | color | ) | ((color >> 8) & 0x000000FF) |
| #define GET_RED | ( | color | ) | ((color >> 16) & 0x000000FF) |
| #define GOLD 0xFFFFD700 |
| #define GOLDENROD 0xFFDAA520 |
| #define GRAY 0xFF808080 |
| #define GREEN 0xFF008000 |
| #define INDIANRED 0xFFCD5C5C |
| #define KHAKI 0xFFF0E68C |
| #define LIGHTBLACK 0xFF3E3E3E |
| #define LIGHTCORAL 0xFFF08080 |
| #define LIGHTSILVER 0xFFD9D9D9 |
| #define LIME 0xFF00FF00 |
| #define MAGENTA 0xFFFF00FF |
| #define MAROON 0xFF800000 |
| #define MENUCLICKBLUE 0xFF6A7298 |
| #define NAVY 0xFF000080 |
| #define OLIVE 0xFF808000 |
| #define ORANGE 0xFFFFA500 |
| #define ORANGERED 0xFFFF4500 |
| #define PALEGOLDENROD 0xFFEEE8AA |
| #define PALEGREEN 0xFF98FB98 |
| #define PURPLE 0xFF800080 |
| #define RED 0xFFFF0000 |
| #define SALMON 0xFFFA8072 |
| #define SET_ALPHA | ( | color, | |
| alpha | |||
| ) | (((color << 8) >> 8) | ((alpha << 24) & 0xff000000)) |
| #define SILVER 0xFFC0C0C0 |
| #define TEAL 0xFF008080 |
| #define TITLEBAR_DARK 0xFF2F2F2F |
| #define TOMATO 0xFFFF6347 |
| #define WHITE 0xFFFFFFFF |
Color codes.
BSD 2-Clause License
Copyright (c) 2022-2023, Manas Kamal Choudhury All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
| #define YELLOW 0xFFFFFF00 |
| XE_LIB void ChColorDrawHorizontalGradient | ( | ChCanvas * | canv, |
| int | x, | ||
| int | y, | ||
| int | w, | ||
| int | h, | ||
| uint32_t | color1, | ||
| uint32_t | color2 | ||
| ) |
| XE_LIB void ChColorDrawVerticalGradient | ( | ChCanvas * | canv, |
| int | x, | ||
| int | y, | ||
| int | w, | ||
| int | h, | ||
| uint32_t | color1, | ||
| uint32_t | color2 | ||
| ) |
ChDrawPixelRAW – draws a pixel to canvas buffer.
| canvas | – pointer to canvas |
| x | – x position |
| y | – y position |
| color | – color of the pixel |
| XE_LIB double clamp | ( | double | x, |
| double | upper, | ||
| double | lower | ||
| ) |