Files
ppsspp/Common/Data/Color/RGBAUtil.h

25 lines
741 B
C
Raw Permalink Normal View History

2012-03-24 23:39:19 +01:00
#pragma once
#include <cstdint>
2012-10-30 13:20:55 +01:00
2012-03-24 23:39:19 +01:00
uint32_t whiteAlpha(float alpha);
uint32_t blackAlpha(float alpha);
2012-05-14 22:07:40 +02:00
uint32_t colorAlpha(uint32_t color, float alpha);
2013-08-16 16:47:25 +02:00
uint32_t colorBlend(uint32_t color, uint32_t color2, float alpha);
2013-04-17 17:08:31 +02:00
uint32_t alphaMul(uint32_t color, float alphaMul);
2012-03-24 23:39:19 +01:00
uint32_t rgba(float r, float g, float b, float alpha);
uint32_t rgba_clamp(float r, float g, float b, float alpha);
2015-09-19 12:25:01 +02:00
typedef unsigned int Color;
#define COLOR(i) (((i&0xFF) << 16) | (i & 0xFF00) | ((i & 0xFF0000) >> 16) | 0xFF000000)
inline Color darkenColor(Color color) {
return (color & 0xFF000000) | ((color >> 1) & 0x7F7F7F);
}
inline Color lightenColor(Color color) {
color = ~color;
color = (color & 0xFF000000) | ((color >> 1) & 0x7F7F7F);
return ~color;
}