BBC BASIC
« Re: New tool color management (num,color or RGB) »

Welcome Guest. Please Login or Register.
Mar 31st, 2018, 10:44pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
We apologize Conforums does not have any export functions to migrate data.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

Thank you Conforums members.
Cross-platform BBC BASIC (Windows, Linux x86, Mac OS-X, Android, iOS, Raspberry Pi)
BBC BASIC Resources
BBC BASIC Help Documentation
BBC BASIC for Windows Home Page
BBC BASIC Programmers' Reference
BBC BASIC Beginners' Tutorial
BBC BASIC for SDL 2.0 Home Page
BBC BASIC Discussion Group

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Re: New tool color management (num,color or RGB)  (Read 535 times)
Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 803
xx Re: New tool color management (num,color or RGB)
« Thread started on: May 22nd, 2016, 10:13am »

on May 22nd, 2016, 03:03am, michael wrote:
you can use RGB values like 010200100 -which is 10,200,100

I wonder why you are using this decimal notation when hexadecimal RGB values are so much more common (your example colour would be 0AC864 in hex). The 'web' (specifically HTML) uses hexadecimal RGB values so you can't get much more standard than that!

Apart from the standardisation issue, conversion from hexadecimal is straightforward:

Code:
      hex$ = "0AC864"      rgb% = EVAL("&"+hex$)      r& = rgb% >> 16      g& = rgb% >> 8      b& = rgb% 

(here using byte variables to avoid explicitly AND-ing with &FF).

Richard.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls