News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Curve2 Color Changer

Started by SMF Customization Team, April 16, 2019, 06:00:27 PM

Previous topic - Next topic

Recursos

Deleted error log.
Uninstalled "Curve2 Color Changer v1.4.1"
Installed "Curve2 Color Changer v1.4.2"
No errors now.
Was it related?

Diego Andrés

Yes, fixed issues.
Thanks for the report.

SMF Tricks - Free & Premium Responsive Themes for SMF.

Recursos

Is there a way to export the edited color scheme and reuse it in another theme?

Diego Andrés

It's not an option at the moment.

SMF Tricks - Free & Premium Responsive Themes for SMF.

shawnb61

Quote from: Recursos on October 16, 2022, 11:43:15 AMIs there a way to export the edited color scheme and reuse it in another theme?

You can use a sql tool to do so though.  Query the parameters in a tool like phpmyadmin.  Export them.  Edit the .sql (theme_id likely needs changing).  Import edited file where needed.

This may be of help also - instructions how to use this mod on themes other than the default:
https://www.simplemachines.org/community/index.php?msg=4126149

Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Recursos

Quote from: shawnb61 on October 16, 2022, 03:13:46 PM(...) instructions how to use this mod on themes other than the default:
https://www.simplemachines.org/community/index.php?msg=4126149

I noticed that "Ready for use color palettes:" (bottom of "Theme Options and Preferences" page) is not displayed after adding the code.
Is it like that, or some mistake of mine?

Recursos

Forget, I just noticed:
"
   // No palettes...
   addJavaScriptVar('txt_cc_palettes', false);
"
Why not keep the palettes?

Diego Andrés

They are per theme too, can't know what colors a theme would provide as options for the color changer.

You'd have to copy the palettes too, or create your own palettes that fit the theme.

SMF Tricks - Free & Premium Responsive Themes for SMF.

kingkingston

This might be the greatest mod ever for someone who just wants an easy way to change his forum's colours

Rheingauner

Is it possible to manually update from version 1.4.1 to 1.4.2 without uninstalling the 1.4.1 version ??

regards

Diego Andrés

Just check the commits from the GitHub repo: https://github.com/SimpleMachines/SMF-mods/pull/25
That's the relevant PR.

I don't really see why you'd do it manually, mod uses hooks so uninstalling/installing will not give you any issues.

SMF Tricks - Free & Premium Responsive Themes for SMF.

Recursos

About Palletes:
Quote from: Diego Andrés on October 17, 2022, 02:27:06 PMThey are per theme too, can't know what colors a theme would provide as options for the color changer.

But if the Theme to be modded with "Curve2 Color Changer" is just a copy of "SMF Default Theme - Curve2", is there any easy way to heep palletes alive?

Lazybones

- Any chance this mod could support prefers-color-scheme: dark and let the admin set a color theme for light and dark preferences? Most browsers and OS now support auto dark mode changing, it would be great to have the forum follow the users preference.
- I tried using the "Create a copy of Default named" feature so that I could have a different color set for users to chose however the copy did not have the mods color option.

Recursos

Quote from: Lazybones on December 23, 2022, 03:02:20 AM- I tried using the "Create a copy of Default named" feature so that I could have a different color set for users to chose however the copy did not have the mods color option.
have a look at post #112 in this topic

Viper013

Hi,

maybe someone have a idea to solve my little problem  :)

With the options "Blocks color" and "Blocks alternate color" i have now different colors for my posts. (post.jpg)
Thats whan i want  :)

But it changes the colors for the category_index as well. (cat_index.jpg)
Thats is not what i want.  :(

How can i change colors only for the category_index.
I want only one color for the index.

Thanks for your help.

Gryzor

Quote from: shawnb61 on May 23, 2022, 09:48:10 PMI have been playing around with this mod also - working on a dark theme for our site. 

I see folks have asked how to use this in multiple copies of curve2.  I've been able to do this by following these 2 steps:

  • Make a copy of curve2 in the acp via "Install a new theme", "Create a copy of Default ".
  • Add the following code to the bottom of template_init() in index.template.php in your new copy:

// No palettes...
addJavaScriptVar('txt_cc_palettes', false);

// Copy settings template over from color changer mod...
$settings['color_changes'] = array(
'background' => array(
array(
'elements' => 'body',
'properties' => array('background')
)
),
'foreground' => array(
array(
'elements' => 'body, strong, .strong, h1, h2, h3, h4, h5, h6, h3.titlebg, h4.titlebg, .titlebg, h3.subbg, h4.subbg, .subbg,
#detailedinfo dt, #tracking dt, .approvebg',
'properties' => array('color')
)
),
'primary_color' => array(
array(
'elements' => 'div.cat_bar, .amt, .dropmenu li a:hover, .dropmenu li:hover a, .dropmenu li a:focus,
#top_info > li > a:hover, #top_info > li:hover > a, #top_info > li > a.open, .button.active, .button.active:hover',
'properties' => array('background', 'border-color')
),
array(
'elements' => '#footer',
'properties' => array('background')
),
array(
'elements' => '.button.active, .button.active:hover',
'properties' => array('color' => '#fff')
)
),
'secondary_color' => array(
array(
'elements' => '.title_bar',
'properties' => array('border-top-color', 'border-bottom-color')
),
array(
'elements' => '.dropmenu li a.active, #top_info li a.active, .dropmenu li a.active:hover, .dropmenu li:hover a.active, a.moderation_link,
a.moderation_link:visited, .new_posts, .generic_bar .bar, .progress_bar .bar',
'properties' => array('background', 'border-color')
)
),
'links' => array(
array(
'elements' => 'a, a:visited, .dropmenu li:hover li a, .dropmenu li li a, .button, .quickbuttons li, .quickbuttons li a,
.quickbuttons li:hover a, .titlebg a, .subbg a, .quickbuttons li ul li a:hover',
'properties' => array('color')
)
),
'gradient_end' => array(
array(
'elements' => '#wrapper, .dropmenu li ul, .top_menu, .dropmenu li li:hover, .button, .dropmenu li li:hover > a, .dropmenu li li a:focus,
.dropmenu li li a:hover, #top_section, #search_form .button, .quickbuttons li, .quickbuttons li ul, .quickbuttons li ul li:hover,
.quickbuttons ul li a:focus, .popup_window, #inner_section, .button:hover, .quickbuttons li:hover, .navigate_section ul, .popup_content, .up_contain,
.button:focus, #search_form .button:hover, .quickbuttons li:hover',
'properties' => array('background')
)
),
'gradient_start' => array(
array(
'elements' => '.dropmenu li ul, .top_menu, .dropmenu li li:hover, .button, .dropmenu li li:hover > a, .dropmenu li li a:focus,
.dropmenu li li a:hover, #top_section, #search_form .button, .quickbuttons li, .quickbuttons li ul, .quickbuttons li ul li:hover,
.quickbuttons ul li a:focus, .popup_window, #inner_section',
'properties' => array('background-image' => 'linear-gradient(to bottom, {color} 0%, transparent 70%)')
),
array(
'elements' => '.button:hover, .button:focus, .quickbuttons li:hover, .navigate_section ul, .popup_content, .up_contain,
#search_form .button:hover, .quickbuttons li:hover',
'properties' => array('background-image' => 'linear-gradient(to bottom, transparent 0%, {color} 70%)')
)
),
'blocks_color' => array(
array(
'elements' => '.windowbg:nth-of-type(even), .bg.even, .information, .roundframe, .generic_list_wrapper, .approvebg,
.windowbg:nth-of-type(odd) blockquote, .windowbg:nth-of-type(even) .bbc_alternate_quote',
'properties' => array('background')
)
),
'blocks_alternate_color' => array(
array(
'elements' => '.windowbg:nth-of-type(odd), .bg.odd, .unread_notify:hover, .title_bar, tr.windowbg:hover,
.windowbg:nth-of-type(even) blockquote, .windowbg:nth-of-type(odd) .bbc_alternate_quote, .bbc_code',
'properties' => array('background')
)
),
'content_target_bg' => array(
array(
'elements' => '.windowbg:target',
'properties' => array('background')
),
),
'borders_color' => array(
array(
'elements' => '#wrapper, .button, .button:hover, .button:focus, .windowbg, .roundframe, .information, #top_section, .navigate_section ul, .dropmenu li ul, .top_menu,
.unread_notify, .pm_unread, .alerts_unread, .dropmenu li li:hover > a, .dropmenu li li a:focus, .dropmenu li li a:hover, .up_contain,
.boardindex_table .board_stats p, .children, #ic_recentposts td, .sub_bar, #info_center .sub_bar, .generic_bar, .progress_bar,
#detailedinfo dl, #tracking dl, .inner, .signature, .attachments, .under_message, .custom_fields_above_signature, .custom_fields_below_signature,
.quickbuttons li, .quickbuttons li:hover, .quickbuttons li ul, .quickbuttons li ul li:hover, .action_admin .table_grid td, .generic_list_wrapper,
#topic_container .windowbg, #topic_icons .information, #messageindex .information, .approvebg, .popup_content, fieldset, #alerts tr.windowbg td,
blockquote, #manage_boards li.windowbg, #manage_boards li.windowbg:last-child, #footer, .bbc_code, #inner_wrap',
'properties' => array('border-color')
),
array(
'elements' => '.title_bar',
'properties' => array('border-left-color', 'border-right-color')
),
array(
'elements' => 'hr',
'properties' => array('background', 'border-color')
)
),
'top_section' => array(
array(
'elements' => '#top_section',
'properties' => array('background')
)
),
'footer' => array(
array(
'elements' => '#footer',
'properties' => array('background')
)
),
'buttons_text_color' => array(
array(
'elements' => 'a.button, .button, .quickbuttons li a, .button:hover, .button:focus, .quickbuttons li:hover>a, .quickbuttons li:hover li a',
'properties' => array('color')
),
),
'buttons_bg' => array(
array(
'elements' => '.button, .quickbuttons li, .button:hover, .button:focus, .quickbuttons li:hover, #search_form .button, #search_form .button:hover',
'properties' => array('background')
)
),
'buttons_border' => array(
array(
'elements' => '.button, .quickbuttons li, .button:hover, .button:focus, .quickbuttons li:hover, #search_form .button, #search_form .button:hover',
'properties' => array('border-color')
)
),
'special_titles_color' => array(
array(
'elements' => '.info .subject, h1.forumtitle a, .poster h4, .poster h4 a, .poster li:hover h4 a, .poster h4 a:hover .poster li h4 a,
.poster h4 a:focus, #smfAnnouncements dt a, .keyinfo h5 a, .keyinfo h5 a strong, .current_page',
'properties' => array('color')
),
array(
'elements' => '#smfAnnouncements dt',
'properties' => array('border-color')
)
),
'sticky_topic' => array(
array(
'elements' => '.windowbg.sticky',
'properties' => array('background')
),
),
'sticky_locked_topic' => array(
array(
'elements' => '.windowbg.sticky.locked',
'properties' => array('background')
)
),
'unapproved_topic' => array(
array(
'elements' => '.windowbg.approvetopic, .windowbg.approvepost, .approvebg',
'properties' => array('background')
)
),
'locked_topic' => array(
array(
'elements' => '.windowbg.locked',
'properties' => array('background')
)
),
'remove_shadows' => array(
array(
'elements' => '*',
'properties' => array('box-shadow' => 'none !important', 'text-shadow' => 'none !important')
)
)
);

This is basically creating a custom theme with the same controls as this mod.  The code above is a slightly modified version of code in buildCss(), following the instructions provided in the mod description.  If buildCss ever changes, what is copied here would need to change, too. 


Hmmm I copied the code to the bottom of template_init() (just before the closing '}') but the mod doesn't appear on my copy of default... any ideas?

[EDIT] Darn, apologies, it worked after a couple of reloads. However, the palette choice at the bottom does not appear. Does it need an update perhaps?

Diego Andrés

Quote from: Gryzor on March 17, 2023, 05:12:30 AM[EDIT] Darn, apologies, it worked after a couple of reloads. However, the palette choice at the bottom does not appear. Does it need an update perhaps?

You also need to create the palettes.
Realistically, it's not useful if it's for your own personal use. Mostly useful if sharing the theme with others.

To add palettes, you need to add another variable.
$settings['color_palettes'] and add arrays with each palette.

E.g. An example with a default palette of the mod:
$settings['color_palettes']['flat'] = array(
	
	
	
	
'primary_color'          => '#24292e',
	
	
	
	
'secondary_color'        => '#0366d6',
	
	
	
	
'background'             => '#f6f8fa',
	
	
	
	
'foreground'             => '#000000',
	
	
	
	
'top_section'            => '#ffffff',
	
	
	
	
'footer'                 => '#24292e',
	
	
	
	
'links'                  => '#334466',
	
	
	
	
'gradient_start'         => '#ffffff',
	
	
	
	
'gradient_end'           => '#ffffff',
	
	
	
	
'blocks_color'           => '#f6f8fa',
	
	
	
	
'blocks_alternate_color' => '#f6f8fa',
	
	
	
	
'content_target_bg'     => '#e0edff',
	
	
	
	
'special_titles_color'   => '#24292e',
	
	
	
	
'borders_color'
	
         => 
'#d1d6dc',
	
	
	
	
'buttons_text_color'     => '#24292e',
	
	
	
	
'buttons_bg'             => '#ffffff',
	
	
	
	
'buttons_border'         => '#24292e',
	
	
	
	
'sticky_topic'             => '#cad7e3',
	
	
	
	
'sticky_locked_topic'          => '#a0acb8',
	
	
	
	
'unapproved_topic'     => '#db9d7b',
	
	
	
	
'locked_topic'          => '#dcdfe3',
	
	
	
	
'remove_shadows'         => true,
	
	
	
);

SMF Tricks - Free & Premium Responsive Themes for SMF.

CraftyLion

How does one change the category colour? At the moment, it's stuck on white and I can't seem to change it ...  ???

Diego Andrés

It's tied to the primary color (I think), you'll need to change it or tweak the css if you need it white.

SMF Tricks - Free & Premium Responsive Themes for SMF.

CraftyLion

Sorry, I meant the category text colour - not the background colour.

Advertisement: