Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add StarOffice style #9

Closed
wants to merge 3 commits into from
Closed

Add StarOffice style #9

wants to merge 3 commits into from

Conversation

flywire
Copy link
Contributor

@flywire flywire commented Jun 27, 2022

Similar to StarOffice IDE, also used in OpenOffice and LibreOffice.

Note that brackets, a subset of Punctuation, are not blue.

@flywire
Copy link
Contributor Author

flywire commented Jun 28, 2022

#6, Reference:

Note: Punctuation varies.

@jmzambon
Copy link
Owner

jmzambon commented Jun 28, 2022

Hi,

This is not functional as it is:

  • new style should also be added to the STYLE_MAP dictionary (pygments.styles), otherwise it will not appear in the option dialog;
  • changes will be lost on next Pygments upgrade, so we need a script to automate the process of adding the starbasic style on oxt building.

@jmzambon
Copy link
Owner

jmzambon commented Jun 29, 2022

After having a look at how Libo IDE works, here is what I understand:

  • red is used for every literals (strings and numbers);
  • green is used for object names;
  • dark red is used for error (but where exactly?);
  • grey is used for comments;
  • blue is used for everything else.

This could be reflected in the new style definition by putting blue as "default_style" and only creating four members in "style" : Comment, Error, Literal and Style. Something like this:

from pygments.style import Style
from pygments.token import Comment, Error, Literal, Name

class StarofficeStyle(Style):
    default_style =             '#000080'    # Blue
    styles = {
        Comment:                '#808080',   # Gray
        Error:                  '#800000',   # Red
        Literal:                '#FF0000',   # Lightred
        Name:                   '#008000',   # Green
    }

@flywire flywire closed this Jun 29, 2022
@flywire flywire deleted the StarOffice_Style branch June 29, 2022 12:29
@flywire
Copy link
Contributor Author

flywire commented Jul 10, 2022

LibreOffice colors are generally darker than HTML:

         Lo_Color              HTML
#000000  Col_Black          =  Black
#000080  Col_Blue           *  Navy
#008000  Col_Green          =  Green
#008080  Col_Cyan              Teal
#800000  Col_Red            *  Maroon
#800080  Col_Magenta           Purple
#808000  Col_Brown             Olive
#808080  Col_Gray           =  Gray
#CCCCCC  Col_Gray3             
#D3D3D3                        LightGray
#666666  Col_Gray7             
#696969                        DimGray
#C0C0C0  Col_Lightgray         Silver
#0000FF  Col_Lightblue      *  Blue
#00FF00  Col_Lightgreen        Lime
#00FFFF  Col_Lightcyan         Aqua
#FF0000  Col_Lightred       *  Red
#FF00FF  Col_Lightmagenta      Fuschia
#E0E0FF  Col_Lightgrayblue     
#E6E6FA                        Lavender
#FFFF00  Col_Yellow         =  Yellow
#FFFFFF  Col_White          =  White

19   Total
 4 * Conflict
 5 = Match
 7   Different
 3   Unnamed
  
Lo_Color constants changed to mixed case for readability

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants