Comments (4)
Will be hard to replace dplug:graphics without it since in dplug:graphics you can assign pixels with a RGBA() struct, but the image is monomorphic. Should the struct be there?
from gamut.
The original code from Manu isn't bad at all... a bit templatey maybe
from gamut.
But we need a ICC profile parser too. Could be basis for colorspace.
ICC parsing and acting on it could bring support for XYB JPEGs.
from gamut.
Color API out there:
raylib: (only sRGB)
Color Fade(Color color, float alpha); // Get color with alpha applied, alpha goes from 0.0f to 1.0f
int ColorToInt(Color color); // Get hexadecimal value for a Color
Vector4 ColorNormalize(Color color); // Get Color normalized as float [0..1]
Color ColorFromNormalized(Vector4 normalized); // Get Color from normalized values [0..1]
Vector3 ColorToHSV(Color color); // Get HSV values for a Color, hue [0..360], saturation/value [0..1]
Color ColorFromHSV(float hue, float saturation, float value); // Get a Color from HSV values, hue [0..360], saturation/value [0..1]
Color ColorTint(Color color, Color tint); // Get color multiplied with another color
Color ColorBrightness(Color color, float factor); // Get color with brightness correction, brightness factor goes from -1.0f to 1.0f
Color ColorContrast(Color color, float contrast); // Get color with contrast correction, contrast values between -1.0f and 1.0f
Color ColorAlpha(Color color, float alpha); // Get color with alpha applied, alpha goes from 0.0f to 1.0f
Color ColorAlphaBlend(Color dst, Color src, Color tint); // Get src alpha-blended into dst color with tint
Color GetColor(unsigned int hexValue); // Get Color structure from hexadecimal value
Color GetPixelColor(void *srcPtr, int format); // Get Color from a source pixel pointer of certain format
void SetPixelColor(void *dstPtr, Color color, int format); // Set color formatted into destination pixel pointer
int GetPixelDataSize(int width, int height, int format); // Get pixel data size in bytes for certain format
CSS color-mod
CSS defines and allows all kinds of colorspaces, such as sRGB, Lch, oklab, Rec2020...
.box {
color: color-mod(purple lightness(62%) red(218) blue(202) whiteness(25%));
color: color-mod(hotpink blend(yellow 59%));
}
Here’s a list of available color adjusters:
alpha: A value for the alpha-transparency between 0% and 100%.
red, green & blue: A value between 0 and 255. Given a starting color of rgb(140, 254, 255), the starting red value would be 140, so anything higher than 140 increases the amount of red in the color and anything lower than 140 decreases the amount of red in color. Green and blue work the same way, with affecting their respective color.
blackness & whiteness: A value between 0% and 100%.
contrast: A value between 0% and 100%.
saturation: A value between 0% and 100%. 0% is gray.
lightness: A value between 0% and 100%. 0% is black, and 100% is white.
tint: A value between 0% and 100%.
hue: A value between 0 and 360.
shade: A value between 0% and 100%. 100% is black.
blend: Blend makes it easy to blend a color with another color. Here’s an example if it’s usage:
from gamut.
Related Issues (20)
- Implement premultiplied alpha in PixelType HOT 11
- GIF support HOT 2
- This image not decodable anymore HOT 4
- Difference of RGBA8 to SDL’s RGBA8888 HOT 7
- Layered images HOT 1
- GIF Exported images seems to never be animated HOT 1
- Bad GIF colors, not sure if input or output HOT 2
- GIF decoder not 100% complete
- Documentation issues : flags not that simple HOT 5
- Meta-data system
- Introduce a port of LZAV HOT 2
- Unpredictable GIF saving behaviour HOT 7
- Webp support HOT 2
- can't setLayout twice HOT 9
- Throwing between in GC programs is annoying
- BMP support
- JPEG-encoded TIFF support HOT 1
- JPEG XL decoding support HOT 2
- JPEG XL ISOBMFF
- Is this an issue (JPEG) HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gamut.