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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,4370411c07c164af X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,UTF8 Path: g2news1.google.com!news3.google.com!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: "Alex R. Mosteo" Newsgroups: comp.lang.ada Subject: Re: Color gradients lib Followup-To: comp.lang.ada Date: Tue, 08 Feb 2011 15:52:24 +0100 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit Injection-Date: Tue, 8 Feb 2011 14:52:36 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="w8g++bW4v3KH0+SqtoCNSw"; logging-data="23020"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19dAq+cPA9yLr6QlXAXtAyu" User-Agent: KNode/4.4.9 Cancel-Lock: sha1:h5rIOK9YYjPB2CDILgAcNvJdfEc= Xref: g2news1.google.com comp.lang.ada:16992 Date: 2011-02-08T15:52:24+01:00 List-Id: Yannick Duchêne (Hibou57) wrote: > Hi Alex, > > Any graphic capabilities requires an output “device”, either memory > bitmap, screen, image file, and the latter may be bitmap, PNG, JPEG. I > feel you miss to provide a context here. Are you seeking for a library to > generate shapes filled with gradient to which kind of output ? This is > important to know. Yes, I was a bit scarce on details. For the output device I have an abstract layer that can output to GTK or a simulator or any other backend I could need, so that's not the issue. I want a function mapping from some arbitrary values (my data, with its minimum and maximum values) into the RGB triplets giving that cold-hot representation. Let's say: type My_Data is float range 0.0 .. 100.0; type RGB_Component is float range 0.0 .. 1.0; type RGB_Color is record R, G, B : RGB_Component; end record; function Gradient (Value : My_Data) return RGB_Color; And that's it. Hope this helps, and thanks for the interest. Alex. > Do not know anything about the context, however an idea : is SVG a valid > option for you ? For graphs, pies, and other formal representations and > plotted images, SVG is rather good (if no dynamic features is required), > and it has gradient capabilities: > http://www.w3.org/TR/SVG/pservers.html > > Otherwise, please tell more about the context and any relevant technical > details. > > > Le Tue, 08 Feb 2011 11:58:00 +0100, Alex R. Mosteo > a écrit: > >> Hello, >> >> I need to plot some data (2D maps) and I have everything in my drawing >> library except some readily usable gradients. I was wondering if some Ada >> library out there has this before making my custom one. >> >> I would need one to represent bad/good ranges (e.g. the default gradient >> blue-cold to red-hot in matlab), and another to show a density of samples >> (perhaps simple shades of gray). >> >> The second one is straightforward, but the first one seems like something >> pretty standard, so I wouldn't like to create one that is similar but not >> the same. >> >> (e.g. the first example in >> http://www.mathworks.com/help/techdoc/visualize/f0-18164.html#f0-5919 ) >> >> Thanks for any suggestions. > >