From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_00,INVALID_MSGID, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,bc7fae210b5e1392 X-Google-Attributes: gid103376,public From: "Sybs ALHABSHI" Subject: Re: how do i include 111111 in an enumaration type ? Date: 1999/10/14 Message-ID: <7u4nmp$n1b$1@minus.oleane.net>#1/1 X-Deja-AN: 536668312 References: <7tsq3o$92p$1@minus.oleane.net> <3802C50A.A5565DDA@callnetuk.com> X-Priority: 3 X-Mimeole: Produced By Microsoft MimeOLE V5.00.2014.211 X-Complaints-To: abuse@oleane.net X-Trace: minus.oleane.net 939909657 23595 194.2.10.8 (14 Oct 1999 14:00:57 GMT) Organization: Guest of OLEANE X-MSMail-Priority: Normal NNTP-Posting-Date: 14 Oct 1999 14:00:57 GMT Newsgroups: comp.lang.ada Date: 1999-10-14T14:00:57+00:00 List-Id: I'm impressed by all the discussion and hints in this thread. I'm lost. It'll take me some time to understand what you're all taking about. Thank you all. I've learned quite a bit. I use ObjectAda 7.1 on NT4.0, and I've managed to built a function that generates the hex color values in real time as well as text colors matching the background through sliders in a simple interface created with GuiBuilder. It works fine and it generates instantly the webpage with the text in the matching colour with one button click. But here, I'd like to attach names to these values, "AdaHome Green" for exemple to color="#99ccbb" ( the background color of adahome.). In many graphic applications, in fashion design etc, color names ( some of them poetic and very beautiful) has a significant meaning. Fashion designers, graphic artistes spend hours matching colours, and certain harmonies patterns are such that you sometimes imagine colours that "aren't there". There are so many palettes to consider, and ofcoarse, as a web designer, I figure it'll be okay if I can define a type 000000 to FFFFFF, then break down to sub types of colors that may describe lifestyles, cultures, color codes, fashion, industries, whatever, as this has become sort of an international standard of defining colors, and an acceptable manner of communicating colour schemes ( screen limitations apart ). I also wonder if I can find a much faster and convenient way of matching what I see on my screen to the hardcopy printer's color scale or brushstroke without going through all the complicated calibration systems, by say simply shifting the values of a sub-type. Which means that the hex values defined in the subtype may vary with the shift, but the names attached relatively to one another may remain the same. So in fact, the names (Indian Red, Canyon Vermillion, Sunset Orange) may refer to three values that can either be 4,5,6, or 5,6,7 or again 3,4,5. So many things I can do with this... The other domaine in which I'd like to apply this, is the attachement of town names to postal codes. In France, 75000 is Paris. 73370 is for " La Chapelle du Mont du Chat". No shifting here... But from what I undestand, 111111 cannot be in an enumeration type. Period. Alas ! But maybe records has the solution... Nick Roberts a �crit dans le message : 3802C50A.A5565DDA@callnetuk.com... > Sybs ALHABSHI wrote: > > In the enumaration type declaration, the string of caracters 000000 is taken > > as a numerical expression. > > > > Can anyone explain how I can get around this ? > > > > type webcolor is (FFFFFF, 000000); > > Sybs, > > I wonder if an enumeration type is what you are looking for here? Take > a look at the following snippet of code. > > type Monochromatic_Level is mod 256; -- i.e. a byte > > type RGB_Color is > record > Red, Green, Blue: Monochromatic_Level; > end record; > > Absolute_Black: constant RGB_Color := (16#00#, 16#00#, 16#00#); > Absolute_White: constant RGB_Color := (16#FF#, 16#FF#, 16#FF#); > > function Hex_Image (Level: Monochromatic_Level) return String is > Digit: constant array (Monochromatic_Level range 0..15) := > ('0', '1', '2', '3', '4', '5', '6', '7', > '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'); > begin > return Digit(Level/16) & Digit(Level mod 16); > end; > > function Hex_Image (RGB: RGB_Color) return String is > begin > return Hex_Image(RGB.Red) & > Hex_Image(RGB.Green) & > Hex_Image(RGB.Blue); > end; > > ... > > Put(Web_File," Put(Web_File," bgcolor=#"); > Put(Web_File,Hex_Image(Background_Color)); > Put(Web_File," text=#"); > Put(Web_File,Hex_Image(Text_Color)); > ... > > Hope this gives you a few ideas. > > -- > Nick Roberts > Computer Consultant (UK) > http://www.callnetuk.com/home/nickroberts > http://www.adapower.com/lab/adaos