

With their valuable input, I made many changes and released v.1.1 (1.1.1 shortly after I posted the article due to another little fix) on October 2009. RGBA stands for red green blue alpha.While it is sometimes described as a color space, it is actually a three-channel RGB color model supplemented with a fourth alpha channel.Alpha indicates how opaque each pixel is and allows an image to be combined over others using alpha compositing, with transparent areas and anti-aliasing of the edges of opaque regions. Many people seemed to like the idea and started using it. I wrote the first version of rgba.php as a complement to a blog post on RGBA that I posted on Februrary 2009. If the directory you specify does not exist or isn’t writeable you’ll get an error. Before you use it, open it with an editor to specify the directory you want it to use to store the created pngs (the default is 'colors/') and add any color names you want to be able to easily address (the defaults are white and black).

Rgba 255 255 255 1 free#
If we're missing a feature, feel free to open an issue 😎. We believe that this lib is sufficient for all of your color manipulation needs.
Rgba 255 255 255 1 code#
At the end of the day, all that matters is that the browser can understand the color string you gave it as a background-color.īecause only those two color models are supported, we don't have to add code to deal with optional alpha channels or converting to non-browser supported color models (e.g. This lib was created with the use case of CSS-in-JS in mind. Less branching in code - only support two color models as outputs, namely rgba and hsla.Simplicity - only handles basic color manipulation functions.There are two secrets that keep this lib especially small: 👋 Compare tree-shaken bundle outputs on bundle.js.org Installation npm i color2k
Rgba 255 255 255 1 full#
The full bundle size is currently 2.8kB but gets as small as 2.1k with tree shaking.

A color parsing and manipulation lib served in roughly 2kB or less (2.8kB to be more precise)Ĭolor2k is a color parsing and manipulation library with the objective of keeping the bundle size as small as possible while still satisfying all of your color manipulation needs in an sRGB space.
