Bjr,

Pour le calcul des couleurs, ce sont des mathématiques (cfr mon tableau
calc).
J'ai adapté la macro pour utiliser un tableau de couleurs fixes.

Yves

Le 7 juin 2018 à 19:43, isaric <isaric...@free.fr> a écrit :

> Merci  Yves Dutrieux.
>
> Pour l'utilisation d'un tableau, je n'ai pas compris.
>
> Macro sur le fichier joint :  Couleur de lettre.odt
> <https://www.cjoint.com/c/HFhp365pd8n>
>
> donne :
> REM  *****  BASIC  *****
>
> sub DiffCouleur12c
> rem ----------------------------------------------------------------------
> rem define variables
> dim document   as object
> dim dispatcher as object
> rem ----------------------------------------------------------------------
> rem get access to the document
> document   = ThisComponent
> curseur=ThisComponent.currentcontroller.ViewCursor
> ' change les 10 caractères qui suivent le curseur courant par une couleur
> pré-définie
> rem couleur premier caractère
>       curseur.goright(1,true)
>       curseur.CharColor=rgb(107,52,02)
>       curseur.goleft(1,false)
>       curseur.goright(1,false)
>
>       curseur.goright(1,true)
>       curseur.CharColor=rgb(14,72,98)
>       curseur.goleft(1,false)
>       curseur.goright(1,false)
>
>       curseur.goright(1,true)
>       curseur.CharColor=rgb(643,20,02)
>       curseur.goleft(1,false)
>       curseur.goright(1,false)
>
>       curseur.goright(1,true)
>       curseur.CharColor=rgb(544,00,96)
>       curseur.goleft(1,false)
>       curseur.goright(1,false)
>
>       curseur.goright(1,true)
>       curseur.CharColor=rgb(887,42,40)
>       curseur.goleft(1,false)
>       curseur.goright(1,false)
>
>       curseur.goright(1,true)
>       curseur.CharColor=rgb(41,21,12)
>       curseur.goleft(1,false)
>       curseur.goright(1,false)
>
>       curseur.goright(1,true)
>       curseur.CharColor=rgb(165,386,24)
>       curseur.goleft(1,false)
>       curseur.goright(1,false)
>
>       curseur.goright(1,true)
>       curseur.CharColor=rgb(544,00,96)
>       curseur.goleft(1,false)
>       curseur.goright(1,false)
>
>       curseur.goright(1,true)
>       curseur.CharColor=rgb(148,869,11)
>       curseur.goleft(1,false)
>       curseur.goright(1,false)
>
>       curseur.goright(1,true)
>       curseur.CharColor=rgb(161,45,95)
>       curseur.goleft(1,false)
>       curseur.goright(1,false)
>
>       curseur.goright(1,true)
>       curseur.CharColor=rgb(22,36,51)
>       curseur.goleft(1,false)
>       curseur.goright(1,false)
>
> rem couleur 12e et dernier caractère
>       curseur.goright(1,true)
>       curseur.CharColor=rgb(106,982,43)
>       curseur.goleft(1,false)
>       curseur.goright(1,false)
>
>
> end sub
>
> C'est pas évident de récupérer les codes de couleur utilisés par
> LibreOffice
> pour les convertir en RVB
>
>
>
> -----
> Utilise Libreoffice avec Ubuntu
> --
> Sent from: http://document-foundation-mail-archive.969070.n3.nabble.
> com/Users-f1744091.html
>
> --
> Envoyez un mail à users+unsubscr...@fr.libreoffice.org pour vous
> désinscrire
> Les archives de la liste sont disponibles à https://listarchives.
> libreoffice.org/fr/users/
> Privacy Policy: https://www.documentfoundation.org/privacy
>



-- 
web site : http://www.molenbaix.com

-- 
Envoyez un mail à users+unsubscr...@fr.libreoffice.org pour vous désinscrire
Les archives de la liste sont disponibles à 
https://listarchives.libreoffice.org/fr/users/
Privacy Policy: https://www.documentfoundation.org/privacy

Répondre à