number colors

ntnt Member Posts: 160
hi,
anyone have the relation between the numbers and the colors in navision?

thanks

Comments

  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    Look in the online Help

    Is it something like

    R * (G * 256) * (B*256*256)
  • ntnt Member Posts: 160
    where i can find the online help?
  • Timo_LässerTimo_Lässer Member Posts: 481
    nt wrote:
    where i can find the online help?
    Have you tried to press F1? ;-)
    Menu ? -> C/SIDE Reference Guide

    I have made a codeunit which can get the red, green and / or blue value from the Navision Color value as well as convert RGB to Navision:
    http://mbs-support.info/dload.php?actio ... file_id=47
    (The page is in german but the codeunit is made with DEU and ENU text constants.)
    Timo Lässer
    Microsoft Dynamics NAV Developer since 1997
    MSDynamics.de - German Microsoft Dynamics Community - member of [clip]
  • charlpcharlp Member Posts: 21
    nt wrote:
    hi,
    anyone have the relation between the numbers and the colors in navision?

    thanks

    The format is RGB (Red, Green, Blue)
    Get the binary value for each, ie. 255 (dec) = 11111111

    So, lets say you had a color 255, 0, 110
    255 = 11111111
    0 = 00000000
    110 = 01101110

    Combine the binary values (11111111 00000000 01101110) and convert the value to decimal = 16711790

    Hope this makes sence.

    PS: You can use Calculater.exe to do this

    Charl
  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    RGB Color Model
    The system uses the RGB color model for specifying colors. This model specifies the intensity of red, green, and blue on a scale of 0 to 255, with 0 (zero) indicating the minimum intensity. The settings of the three colors are converted to a single integer value by using this formula:

    RGB value:= Red + (Green*256) + (Blue*256*256)

    Examples:

    Red
    Green
    Blue
    RGB value
    Color

    255
    0
    0
    255
    Red

    0
    255
    0
    65280
    Green

    0
    0
    255
    16711680
    Blue

    0
    255
    255
    16776960
    Cyan

    255
    0
    255
    16711935
    Magenta

    255
    255
    0
    65535
    Yellow

    255
    255
    255
    16777215
    White

    128
    128
    128
    8421504
    Gray

    0
    0
    0
    0
    Black


    To extract the settings of the red, green and blue elements from an RGB value, you can use this method:

    Convert the RGB value to a hexadecimal value. This will give you a hexadecimal number with up to six digits. From right to left, each pair of hexadecimal digits is the setting of red, green and blue, respectively, and can be converted back to decimal. (If the hexadecimal number contains less than six digits, fill out the number with zeroes on the left.)

    Examples:

    RGB
    Hex
    Red
    Blue
    Green

    6579300
    646464
    100
    100
    100

    16422450
    FA9632
    50
    150
    250
  • ntnt Member Posts: 160
    ok guys
    thanks :wink:
Sign In or Register to comment.