Color-565 Library

Aus ProjectWiki
Version vom 8. April 2015, 10:45 Uhr von Mat (Diskussion | Beiträge) (Created page with "== Overview == Contains functions to map colors from 24-Bit RGB space to 16-Bit RGB space and vice versa and a list of 500+ named colors. == How to use == Include the library. ...")
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Wechseln zu:Navigation, Suche

Overview

Contains functions to map colors from 24-Bit RGB space to 16-Bit RGB space and vice versa and a list of 500+ named colors.


How to use

Include the library.

$include "Colors565.inc"

Convert 24-Bit RGB (8 Bit each) to 16 Bit (R: 5 Bit, G: 6 Bit, B: 5 Bit)

Dim Color As Word
Color = Color24to16([R], [G], [B])

Convert 16 Bit back to 24 Bit colors

Dim R As Byte, G As Byte, B As Byte
Color16to24 [16 Bit color], R, G, B

Included is a list of constants with 500+ named colors, which are also listed in the corresponding Excel-sheet and an example how to define custom color constants:

Const Color_custom =(((RED_8bit * 249) + 1014) And &HF800) + (Int(((GREEN_8bit * 253) + 505) / 32) And &H07E0) + Int(((BLUE_8bit * 249) + 1014) / 2048)


This Software is Donationware. <paypal>1</paypal> See here for more informations


Download