The code used to generate the colours is based on the work of Dan Bruton.This demo was utilised in the paper Teaching Beer’s Law and Absorption Spectrophotometry with a Smart Phone: A Substantially Simplified Protocol by Thomas S. YUV can also be defined using more than 8 bits per sample for some applications. The AYUV format, which is a 4:4:4 format, uses 8 bits each for the Y, U, and V samples. The above tool should been seen as more of an approximation than a rigorous resource. To convert 4:2:0 or 4:2:2 YUV to RGB, we recommend converting the YUV data to 4:4:4 YUV, and then converting from 4:4:4 YUV to RGB. We can see colours which are outside of the gamut of the RGB scheme - there is no unique mapping that definitively converts a wavelength to a colour, and as such However, due to the very complex way in which the eye perceives colours, In this model, each colour is given a value for each red, green and blues components ranging from 0 to 255, giving a total value of 16.7 million possible colours. We can begin to build up a picture of how frequency is related to colour.Ī frequent way of referring to colour on computer screens is by using the RGB system. The lasers in your Blu-ray player emit at 405nm, which as the name suggests, is blue. Helium-neon lasers emit at 632.8nm, which is a bright red. However, a laser for example, emits only at a single very specific frequency. Sunlight appears white to us because it emits almost uniformly over all visible frequencies. Higher frequency radiation, such as x-rays are absorbed by the atmosphere, as are lower frequencies, such as microwaves. The particular range of wavelengths coincides with a window in the Earth's atmosphere, through which this light can travel. It ranges between 0 for identical colours and 3*(255^2) for the distance between pure black and pure white.Over the course of millions of years, the human eye has evolved to detect light in the range 380-780nm,Ī portion of the electromagnetic spectrum known as visible light, which we perceive as colour. This is part of the value used to calculate dst_rgb8, but since it involves no square root it will be cheaper to calculate, for use in cases where only the relative values matter, such as when picking the "best match" out of a set of colors. This is the sum of the squares of the differences of each of the color components. Return a measure of the distance between the two colors. dst_rgb8_cheap $measure = $color->dst_rgb8_cheap( $other ) Two identical colors will have a measure of 0, pure black and pure white have a distance of 1, and all others will lie somewhere inbetween. This is the unweighted Euclidean distance of the three color components. dst_rgb8 $measure = $color->dst_rgb8( $other ) $alpha should be an integer in the range 0 to 255. Similar to alpha_blend but works with integer arithmetic. alpha8_blend $mix = $color->alpha8_blend( $other, ) Values closer to 0 will blend more of $color, closer to 1 will blend more of $other. The optional $alpha parameter defines the mix ratio between the two colors, defaulting to 0.5 if not defined. Return a new color which is a blended combination of the two passed into it. alpha_blend $mix = $color->alpha_blend( $other, ) Returns a string representation of the color components in the RGB8 space, in a convenient RRGGBB hex string, likely to be useful HTML, or other similar places. Returns the individual red, green and blue color components of the color value in RGB8 space. rgb8 ( $red, $green, $blue ) = $color->rgb8 It can also be given in the form of a hex encoded string, such as would be returned by the rgb8_hex method: rrggbb METHODS red $r = $color->red green $g = $color->green blue $b = $color->blueĪccessors for the three components of the color. The string should be in the form red,green,blueĬontaining the three integer values in decimal notation. Parses $string for values, and construct a new object similar to the above three-argument form. $color = Convert::Color::RGB8->new( $string ) Values outside of this range will be clamped. These values should be integers between 0 and 255. Returns a new object to represent the set of values given. CONSTRUCTOR new $color = Convert::Color::RGB8->new( $red, $green, $blue ) For representations using 16-bit integers, see Convert::Color::RGB16. as 8 bits.įor representations using floating point values, see Convert::Color::RGB. Objects in this class represent a color in RGB space, as a set of three integer values in the range 0 to 255 i.e. Convert::Color::RGB8 - a color value represented as red/green/blue in 8-bit integers SYNOPSIS
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |