Documentation/Calc Functions/FARVE

    From The Document Foundation Wiki
    This page is a translated version of the page Documentation/Calc Functions/COLOR and the translation is 17% complete.
    Outdated translations are marked like this.


    Funktionsnavn:

    FARVE

    Kategori:

    Matematisk

    Resume:

    Returnerer en numerisk værdi beregnet af en kombination af tre farver (rød, grøn og blå) og alfa-kanalen i RGBA-farvesystemet. Resultatet afhænger af det farvesystem, din computer bruger.

    Syntaks:

    FARVE(Red; Green; Blue[; Alpha])

    Returnerer:

    Returnerer et positivt heltal.

    Argumenter:

    Rød, Grøn and Blå (obligatorisk) Værdien af farvekomponenterne rød, grøn and blå. Værdierne skal være mellem 0 og 255. Nul betyder ingen farvekomponent og 255 betyder fuld farvekomponent.

    Alfa (valgfri) Værdien for alfa-kanalen eller alfa-komponenten.

    Alfa er en heltalsværdi mellem 0 og 255. Værdi 0 for alfa betyder, at farven er helt transparent, mens værdien 255 i alfakanalen giver en heldækkende farve.
    
    • Hvis ét af argumenterne er et decimaltal, anvendes dets gulvværdi.
    • Hvis ét af argumenterne er mindre end 0 eller større end 255, returnerer funktionen en fejlværdi.

    Alpha is an integer in the range [0, 255], or a reference to a cell containing that number, that is the value for the alpha channel. If omitted, a default value of 0 is applied. A value of 0 means that the color is fully transparent, whereas a value of 255 gives a fully opaque color.

    • If any argument is non-numeric, then FARVE reports a #VÆRDI! error.
    • If any argument is a non-integer value, then FARVE converts it to an integer by taking its floor value.
    • If any argument is less than 0 or greater than 255, then FARVE reports an invalid argument error (Fejl:502).

    Yderligere oplysninger:

    • Ingen
    • FARVE combines the samples using the following formula:
      [math]\displaystyle{ \text\lt span lang="en" dir="ltr" class="mw-content-ltr"\gt {COLOR}(red, green, blue, alpha)~=~256*256*256*alpha~+~ 256*256*red~+~256*green~+~blue\lt /span\gt }[/math]
    • 232 is equal to 4294967296.

    Eksempler:

    Formula Description Returns
    =FARVE(255; 255; 255; 255) All components take their maximum values and FARVE returns the value 4294967295 (hex 0xFFFFFFFF). 4294967295
    =FARVE(D1; D2; D3; D4) where cells D1, D2, D3, and D4 all contain the number 119. All components take the value 119 and FARVE returns the value 2004318071 (hex 0x77777777). 2004318071
    =FARVE(119,2; 119,7; 119,5; 119,9) FARVE takes the floor value of each argument. After truncation, all components take the value 119 and FARVE returns the value 2004318071 (hex 0x77777777). 2004318071
    =FARVE(255; 255; 255) Here no value for the alpha channel is specified and the default value of 0 is assumed. FARVE returns the value 16777215 (hex 0x00FFFFFF). 16777215
    =FARVE(11; 12; 13; 10) This example is useful to confirm how the function constructs the coded value by viewing its structure in hexadecimal format. FARVE returns the value 168496141 (hex 0x0A0B0C0D). 168496141

    Beslægtede LibreOffice-funktioner:

    Ingen

    ODF standard:

    Ingen

    Tilsvarende Excel-funktioner:

    Ingen