44 lines
1.8 KiB
C
44 lines
1.8 KiB
C
/* *****************************************************************************
|
|
* libg1m/color.h -- the libg1m color constants.
|
|
* Copyright (C) 2017 Thomas "Cakeisalie5" Touhey <thomas@touhey.fr>
|
|
*
|
|
* This file is part of libg1m.
|
|
* libg1m is free software; you can redistribute it and/or modify it
|
|
* under the terms of the GNU Lesser General Public License as published by
|
|
* the Free Software Foundation; either version 3.0 of the License,
|
|
* or (at your option) any later version.
|
|
*
|
|
* libg1m is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
* See the GNU Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
* along with libg1m; if not, see <http://www.gnu.org/licenses/>.
|
|
*
|
|
* These colors are mainly for coloring text in e-activities on modern
|
|
* graph calculators (with color LCDs). There is one color byte for each
|
|
* character, and each byte is 0xMC, where M is the marker color (background
|
|
* color) and C is there character color (foreground color).
|
|
* ************************************************************************** */
|
|
#ifndef LIBG1M_COLOR_H
|
|
# define LIBG1M_COLOR_H
|
|
|
|
/* The colors: */
|
|
typedef int g1m_color_t;
|
|
# define g1m_color_black 0x0
|
|
# define g1m_color_blue 0x1
|
|
# define g1m_color_green 0x2
|
|
# define g1m_color_cyan 0x3
|
|
# define g1m_color_red 0x4
|
|
# define g1m_color_magenta 0x5
|
|
# define g1m_color_yellow 0x6
|
|
# define g1m_color_white 0x7
|
|
|
|
/* And some macros to help you out: */
|
|
# define g1m_marker_color(C) (((C) & 0xf0) >> 4)
|
|
# define g1m_char_color(C) ((C) & 0xf)
|
|
# define g1m_character_color(C) g1m_char_color(C)
|
|
|
|
#endif /* LIBG1M_COLOR_H */
|