Can a function within the functions.php file call another function from inside functions.php? I am speculating yes and and that's why I authored the code below, however it does not work for whatever reason. Can anybody please take a look and assist me to.

I attempted calling pageBarColor() from register_sidebar()

Thanks.

<?php
if (function_exists('register_sidebar')) {
  register_sidebar(array(
   'before_widget' => '<li class="sidebarModule">',
   'after_widget' => '</li><!-- end module -->',
   'before_title' => '<h2 class="moduleTitle '.pageBarColor().'">',
   'after_title' => '</h2>',
  ));
}

function pageBarColor(){
    if(is_category('3')) {
        return "color1";
    } elseif(is_category('4')) {
        return "color2";
    } elseif(is_category('5')) {
        return "color3";
    } elseif(is_category('6')) {
        return "color4";
    } elseif(is_category('7')) {
        return "color5";
    }
}
?>

The issue is most likely that after you call register_sidebar Wordpress has not performed the code which determines caused by is_category. By trying calling your pageBarColor function straight after determining it its does not return anything. Just one way of working around this is to hook in to the dynamic_sidebar_params filter (that is known as whenever you call dynamic_sidebar inside your templates, presuming you need to do) increase your widget before_title values, something similar to this:

function set_widget_title_color($widgets) {
    foreach($widgets as $key => $widget) {
        if (isset($widget["before_title"])) {
            if(is_category('3')) {
                $color = "color1";
            } elseif(is_category('4')) {
                $color = "color2";
            } elseif(is_category('5')) {
                $color = "color3";
            } elseif(is_category('6')) {
                $color = "color4";
            } elseif(is_category('7')) {
                $color = "color5";
            }

            if (isset($color)) $widgets[$key]["before_title"] = str_replace("moduleTitle", "moduleTitle ".$color, $widget["before_title"]);
        }
    }
    return $widgets;
}
add_filter('dynamic_sidebar_params', 'set_widget_title_color');