X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FKernel%2Fdrv%2Fvterm_font.c;fp=KernelLand%2FKernel%2Fdrv%2Fvterm_font.c;h=cb2702d9c12c23b935aa4d33ea79e7eb05bc222d;hb=45ea05112879353e05848dde97fff36615721d6b;hp=f084c5b3f37545827c373f32a02759eef6fc1b9c;hpb=77c5f08971d6354aee5d402d25adea8d82b6e67b;p=tpg%2Facess2.git diff --git a/KernelLand/Kernel/drv/vterm_font.c b/KernelLand/Kernel/drv/vterm_font.c index f084c5b3..cb2702d9 100644 --- a/KernelLand/Kernel/drv/vterm_font.c +++ b/KernelLand/Kernel/drv/vterm_font.c @@ -132,6 +132,18 @@ void VT_Font_Render(Uint32 Codepoint, void *Buffer, int Depth, int Pitch, Uint32 } } +Uint16 VT_Colour24to12(Uint32 Col24) +{ + Uint16 ret = 0; + + for( int i = 0; i < 3; i ++ ) + { + Uint32 comp = (Col24 >> (i*8)) & 0xFF; + ret |= ((comp * 15) / 255) << (i*4); + } + return ret; +} + /** * \fn Uint32 VT_Colour12to24(Uint16 Col12) * \brief Converts a 12-bit colour into 24 bits