ruby-****@sourc*****
ruby-****@sourc*****
2013年 4月 12日 (金) 07:23:28 JST
------------------------- REMOTE_ADDR = 184.145.81.37 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-appdx-clrtheory ------------------------- TITLE = tut-gtk2-appdx-clrtheory KEYWORD = = (A12.3) Ruby Tutorial - Appendix {{link "tut-gtk2-dancr-rbcatut-dwc#Gradient Sources", "tut-gtk2-dancr-rbcatut-intro", "tut-gtk", "tut-gtk"}} # (12.3) [current file: ... tut-gtk2-appdx-clrtheory] # [next file: ...... tut-gtk] # First needed in 12.3.2.1.2 #= Sorry, this sub-chapter is still under construction {{br}} == Digital Colour Theory (A12.1){{br}} #### Throughout our existence, we humans learned, that all existing colours in nature can be created from three (red, green, and blue) basic natural (or better, elementary) colours. This sets the ground to define eight basic colours (000=black, 001=blue, 010=green, 011=turquoise, 100=red, 110=yellow, 101=pink and 111=white). However, depending on the amount/intensity of any of the three (rgb) colours, we can create different shades of these basic colours, some of which, we humans, throughout our evolution also named as different colours. For instance by changing the intensity of the two components that naturally give us either orange or yellow, gives us colour we humans call "brown". Throughout our existence we learned that all existing colours in nature can be created from three (red, green, and blue) basic natural (or better, elementary) colours. This sets the ground to define seven basic colours (000=black, 001=blue, 010=green, 011=turquoise, 100=red, 110=yellow, and 111=white). However, depending on the amount/intensity of any of the three (rgb) colours, we can create different shades of these basic colours, some of which we named as different colours. For instance by changing the intensity of the two components that naturally give us either orange or yellow, we can make a colour we named "brown". Note, that we are not even mentioning colour names with exotic prefixes, postfixes and odd colour compositions such as light-olive-green, yellowish-brown, bluish-pink, etc. Rather than totally reinventing the colour naming schemes, let's concentrate on the elementary colours a child can name in any language. First, we can identify three categories of colours which we should be then able to map into digital colour language, maps and charts. :The three categories of colours: a) The three elementary colours (red, green, and blue). b) The seven basic colours (black, blue, green, turquoise, red, yellow, and white). c) The shades of all of the above (brown, orange, ...). Since each byte can have 256 different values, we can use these values to quantify the amount (or if you prefer the intensity) of any one of the three elementary colours. (For instance if you mix 1 mL (one millilitre) or say, one brush full of red and a 1/2 mL (half a brush) of yellow you'd get orange.) Actually, for all practical purposes, to define all basic colour shades, we would only need each byte to represent three different colour defining values (full, half, none/empty), which are then used to define the defining rgb colours. Because the each rgb component in cybernetics contains 256 possible values computer graphics scientists reserved three values out of this range to represent full=255 (hex:FF), half=128 (hex:80) and empty=0 (hex:00). === The Defining Colours. The three colour values FF (255), 80 (128) and (0), we just learned computer graphic engineers reserved for "full, half and empty" markers, are used to define all easy recognizable colours, a.k.a. defining colours. :Complementary Note that reserving these three values from the total of 256 values a byte can hold, still lives us 252 unused values to define all the different colour shades. The first 126 values can therefor be used to quantify the strength/quantity or intensity for colours represented with the "full (hex:FF)" designation, that is, those colours we metaphorically identified as "full brush" and which are digitally defined in the range from 254 (xFE) to 127 (x7A), and 126 values to quantify the strength for the colours defined in the range from 128 (x80) to 1 (x01), that is the colours defined below the value 128 (x80). (Indeed, the reserved value for empty need not be quantified, since it means no colour /zero means no quantity/). :The Three Categories Of Defining Colours. * DEFINING COLOURS (defined as FF(s); can also include the subset of (i) below. * DEFINING COLOURS WITH SHADES (defined as FF & 80 in any order.) * DEFINING COLOURS COMPOSED ONLY OF SHADES (defined as 80s; can also include FFs) {{image_left("color-codes-s1.png")}} The image on the left should give you an idea how to interpret the numbers in the above thre categories. :Possible Value Combinations For All Three Groups Of Defining Colours # seeA: ~/work/01-pgmLearn/00allPgmDOC/00-generic-prg-eg:HEX/color-analysis.txt (Since colours are listed in ascending order, do not be confused with row "1R" it is repeated for clarity, because it also belongs to a special group where all components have the same value. The smaller the value the darker grey we get, black being the darkest, and on the other side white - the brightest.) :Note In the above table, we consistently use FF and 80 rather than FA and 7F (even when this is incorrect - i.e. the darkest orange or brown colours should have codes "ff fa 00" and "fa 7f 00" rather than "ff ff 00" and "ff 80 00", respectively) because they are easier to distinguish for human reader (easier for eyes), and the error (overlap) is tolerable. (FF, 80 only cause the overlap at the colour brake, which for human eye is unrecognizable, anyway.) You should also notice that, while some colours for human eye are very hard to correctly identify, digitally they can be defined with absolute certainty, which may have some significance for a scientist but is rather useless for an artist or an art lover. Also note that the groups (1), (6) and (7) are a special case that actually create a very distinct "non-colour" (black and white) group. On top of that, groups (1) "white" and (7) "black" mark the beginning and end of the digital spectrum, which for human eye translates into a characteristic called brightness, that runs from the darkest colour to the brightest one. :The rules that define relationships between the RGB colour components # {{image_right("")}} # ((<|URL:http://...>)) # ((<|>)) # dialog-warning.png :Return point: 12.3.2.1.2 ((<Gradient Sources|tut-gtk2-dancr-rbcatut-dwc#Gradient Sources>)) {{br}} :Copyright: Copyright 2013 Igor Pirnovar (for terms see GPL License)