dabisu / sakura

GTK/VTE based terminal emulator
https://launchpad.net/sakura
GNU General Public License v2.0
176 stars 22 forks source link

no documentaion to create a new color palette #36

Closed nakibrayan3 closed 1 year ago

nakibrayan3 commented 1 year ago

i want to add dracula color scheme to the default color palettes but i don't what color is which (blue, yellow, green, etc...).

const GdkRGBA dracula_palette[PALETTE_SIZE] = {
        {0, 0, 0, 1},
        {0, 0, 0, 1},
        {0, 0, 0, 1},
        {0, 0, 0, 1},
        {0, 0, 0, 1},
        {0, 0, 0, 1},
        {0, 0, 0, 1},
        {0, 0, 0, 1},
        {0, 0, 0, 1},
        {0, 0, 0, 1},
        {0, 0, 0, 1},
        {0, 0, 0, 1},
        {0, 0, 0, 1},
        {0, 0, 0, 1},
        {0, 0, 0, 1},
        {0, 0, 0, 1}
};
dabisu commented 1 year ago

Hello. Palette are in GdkRGBA format, you should get the rgba data for the Dracula palette. I see in dracula website are available in rgb, you just need to convert the values (0-254) to a (0-1) scale.

nakibrayan3 commented 1 year ago

i get that. but which one of the list items is red, blue, ...etc ?

dabisu commented 1 year ago

From the GTK documentation:

GdkRGBA is a convenient way to pass colors around. It’s based on cairo’s way to deal with colors and mirrors its behavior. All values are in the range from 0.0 to 1.0 inclusive. So the color (0.0, 0.0, 0.0, 0.0) represents transparent black and (1.0, 1.0, 1.0, 1.0) is opaque white. Other values will be clamped to this range when drawing.